dotfiles

My dotfiles: zsh, lf, sxiv, i3, ranger, mpd and more
Log | Files | Refs | Submodules | README | LICENSE

torrent (853B)


      1 #!/bin/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}' | paste -sd ' '
     18 
     19 case $BLOCK_BUTTON in
     20 	1) setsid -f "$TERMINAL" -e tremc ;;
     21 	2) td-toggle ;;
     22 	3) notify-send "🌱 Torrent module" "\- Left click to open tremc.
     23 - Middle click to toggle transmission.
     24 - Shift click to edit script.
     25 Module shows number of torrents:
     26 🛑: paused
     27 🕰: idle (seeds needed)
     28 🔼: uploading (unfinished)
     29 🔽: downloading
     30 ✅: done
     31 🌱: done and seeding" ;;
     32 	6) "$TERMINAL" -e "$EDITOR" "$0" ;;
     33 esac