voidrice/.local/bin/statusbar/sb-torrent
Jameson 7a96fb100c
script fixes (#1386)
* fix typo in lfub

* use setsid when editing scripts

* fix immediate exit on middle click

---------

Co-authored-by: 2084x <2084x@noreply.codeberg.org>
2023-12-30 17:04:51 +00:00

27 lines
726 B
Bash
Executable file

#!/bin/sh
transmission-remote -l | grep % |
sed " # The letters are for sorting and will not appear.
s/.*Stopped.*/A 🛑/;
s/.*Seeding.*/Z 🌱/;
s/.*100%.*/N ✅/;
s/.*Idle.*/B 🕰️/;
s/.*Uploading.*/L ⬆️/;
s/.*%.*/M ⬇️/" |
sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' -
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e stig ;;
2) td-toggle ;;
3) notify-send "🌱 Torrent module" "\- Left click to open stig.
- Middle click to toggle transmission.
- Shift click to edit script.
Module shows number of torrents:
🛑: paused
🕰: idle (seeds needed)
🔼: uploading (unfinished)
🔽: downloading
✅: done
🌱: done and seeding" ;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac