21 lines
420 B
Plaintext
Raw Normal View History

#!/bin/sh
echo ""
data() { transmission-remote -l | grep %; }
[ ! "$(data)" ] && { echo ""; exit 1; }
per="$(data | awk '{ print $2 }')"
icon="$(data | sed "
2020-05-13 15:07:01 +02:00
s/.*Stopped.*//g;
s/.*Seeding.*//g;
s/.*Idle.*//g;
s/.*Uploading.*//g;
s/.*%.*//g
")"
for i in $(seq "$(data | wc -l)"); do
echo "$per" | awk -v n="$i" 'NR==n' | sed 's/100%//g'
echo "$icon" | awk -v n="$i" 'NR==n'
done