transmission-notify.sh 730 B

12345678910111213141516
  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. # Updates the bar torrents module
  8. # if pgrep "polybar"; then
  9. # polybar-msg -p "$(pidof "polybar")" hook torrents 1
  10. # fi
  11. #awk '{print $2 "\t" $3 "\t"}{for(i = 9; i < 20; i++) printf $i}'
  12. #echo "$torrents" | sed '1d' | awk '{printf $2 "\t" $3}{for(i = 1; i < 10; i++) $i=""}{print}'