voidrice/.local/bin/statusbar/torrent

34 lines
853 B
Text
Raw Normal View History

#!/bin/sh
2019-11-23 21:23:24 +00:00
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;
2019-11-23 21:23:24 +00:00
s/L/🔼/g;
s/M/🔽/g;
s/N/✅/g;
2020-05-25 21:06:24 +00:00
s/Z/🌱/g" | awk '{print $2 $1}' | paste -sd ' '
2019-11-23 21:23:24 +00:00
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e tremc ;;
2) td-toggle ;;
3) notify-send "🌱 Torrent module" "\- Left click to open tremc.
- Middle click to toggle transmission.
- Shift click to edit script.
Module shows number of torrents:
🛑: paused
🕰: idle (seeds needed)
2019-11-23 21:23:24 +00:00
🔼: uploading (unfinished)
🔽: downloading
✅: done
🌱: done and seeding" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
2019-11-23 21:23:24 +00:00
esac