transmission-status.sh 904 B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. # A super hacky script to display the torrents in transmission in a notification
  4. # torrents="$(transmission-remote -l | grep -v Done | grep -v Stopped)"
  5. # torrents=$(transmission-remote -l | sed '/Sum/d')
  6. # notify-send "Seeding torrents" "$(echo "$torrents" | sed '1d' | grep Seeding | awk '{printf $2 " " $3 " " $4 " "}{for(i = 10; i < 30; i++) printf $i" "}{print ""}' | awk '{$1=$1};1')"
  7. while true;do
  8. clear
  9. transmission-remote -tactive -l | grep -v '100%' | sed '/Sum/d'
  10. # transmission-remote -l | grep -v '100%' | sed '/Sum/d'
  11. sleep 1
  12. done
  13. # Updates the bar torrents module
  14. # if pgrep "polybar"; then
  15. # polybar-msg -p "$(pidof "polybar")" hook torrents 1
  16. # fi
  17. #awk '{print $2 "\t" $3 "\t"}{for(i = 9; i < 20; i++) printf $i}'
  18. #echo "$torrents" | sed '1d' | awk '{printf $2 "\t" $3}{for(i = 1; i < 10; i++) $i=""}{print}'