*nohtml*

local/bin/torrents

   1 #!/bin/bash
   2 
   3 [[ $(pgrep transmission) ]] &&
   4 transmission-remote -l | sed '1d; $d; s/\s\+\s/|/g' |
   5 cut -d \| -f 3,9,10 | column -ts \|
   6 
   7 [[ $(pgrep qbittorrent) ]] &&
   8 curl -s http://127.0.0.1:9092/api/v2/sync/maindata |
   9 jq -r '.torrents[] | [.priority, .progress, .state, .name] | @tsv' | sort -n |
  10 awk -F \\t '{ printf "%d%%|%s|%s\n", ($2 * 100), $3, $4 }' | column -ts \|