voidrice/.local/bin/statusbar/torrent
mokulus 5d59b3927d
Fix minor statusbar issues (#597)
* Fix: Remove trailing space from battery

* Unify spacing in disk

* Fix news

Don't display news module when there are no news.

* Use grep -F in pacpackages

* Fix torrent

Remove trailing whitespace *after* replacing newlines.

* Quote sed command
2020-04-24 08:44:48 -04:00

27 lines
672 B
Bash
Executable file

#!/bin/sh
transmission-remote -l | grep % |
sed " # This first sed command is to ensure a desirable order with sort
s/.*Stopped.*/A/g;
s/.*Seeding.*/Z/g;
s/.*100%.*/N/g;
s/.*Idle.*/B/g;
s/.*Uploading.*/L/g;
s/.*%.*/M/g" |
sort -h | uniq -c | sed " # Now we replace the standin letters with icons.
s/A/🛑/g;
s/B/⌛️/g;
s/L/🔼/g;
s/M/🔽/g;
s/N/✅/g;
s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed 's/ $//'
case $BLOCK_BUTTON in
1) $TERMINAL -e tremc ;;
3) notify-send "Torrent module" "🛑: paused
⏳: idle (seeds needed)
🔼: uploading (unfinished)
🔽: downloading
✅: done
🌱: done and seeding" ;;
esac