torrent (718B)
1 #!/usr/bin/env sh 2 3 transmission-remote -l | grep % | 4 sed " # This first sed command is to ensure a desirable order with sort 5 s/.*Stopped.*/A/g; 6 s/.*Seeding.*/Z/g; 7 s/.*100%.*/N/g; 8 s/.*Idle.*/B/g; 9 s/.*Uploading.*/L/g; 10 s/.*%.*/M/g" | 11 sort -h | uniq -c | sed " # Now we replace the standin letters with icons. 12 s/A/🛑/g; 13 s/B/⌛️/g; 14 s/L/🔼/g; 15 s/M/🔽/g; 16 s/N/✅/g; 17 s/Z/🌱/g" | awk '{print $2, $1}' | sed -e "s/ $//g" 18 19 case $BLOCK_BUTTON in 20 1) $TERMINAL -e transmission-remote-cli ;; 21 3) pgrep -x dunst >/dev/null && notify-send "Torrent module" "🛑: paused 22 ⏳: idle (seeds needed) 23 🔼: uploading (unfinished) 24 🔽: downloading 25 ✅: done 26 🌱: done and seeding" ;; 27 esac 28