2020-02-08 23:43:37 +00:00
|
|
|
#!/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;
|
2020-05-07 21:31:42 +00:00
|
|
|
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
|
2020-05-30 21:01:18 +00:00
|
|
|
1) setsid -f "$TERMINAL" -e tremc ;;
|
2020-05-07 21:31:42 +00:00
|
|
|
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" ;;
|
2020-05-07 21:31:42 +00:00
|
|
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
2019-11-23 21:23:24 +00:00
|
|
|
esac
|