summaryrefslogtreecommitdiff
path: root/bin/extra/trmv
blob: 22d9e480179a872ce5178e7ca7bc41f0eab164b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

trr() { transmission-remote 192.168.178.79 "$@"; }

id="$(trr -t all -l | tail -n +2 | head -n -1 | fzf | awk '{print $1}')"
[ "$id" ] || exit 1
name="$(trr -t "$id" -i | grep '^\s*Name:' | cut -f 4- -d ' ')"
location="$(trr -t "$id" -i | grep '^\s*Location:' | cut -f 4- -d ' ')"

>&2 printf '#%s\n' "$id"
>&2 printf "old name: %s\n" "$name"
>&2 printf 'new name: '
trr -t "$id" --path "$name" --rename "$(head -n 1)"