Added ability to move torrents.
This commit is contained in:
parent
1a013814aa
commit
1e4ca3a622
@ -1,12 +1,47 @@
|
|||||||
#!/bin/sh
|
#!/bin/env bash
|
||||||
|
|
||||||
id=$(transmission-remote -l | dmenu -l 10 | awk '{print $1}'| sed 's/*//')
|
id=$(transmission-remote -l | dmenu -l 10 | awk '{print $1}'| sed 's/*//')
|
||||||
|
|
||||||
[ -z "$id" ] && exit 0
|
[ -z "$id" ] && exit 0
|
||||||
|
|
||||||
case "$(printf "Start\\nStop\\nRemove" | dmenu -p "Torrent Action: ")" in
|
move () {
|
||||||
Remove) transmission-remote -t $id -r ;;
|
declare -a paths=(
|
||||||
Start) transmission-remote -t $id -s ;;
|
"$HOME/Videos/anime"
|
||||||
Stop) transmission-remote -t $id -S ;;
|
"$HOME/Videos/movies"
|
||||||
*) exit ;;
|
"$HOME/Documents/manga"
|
||||||
|
"$HOME/Documents/lightnovels"
|
||||||
|
"$HOME/Games/torrents"
|
||||||
|
)
|
||||||
|
|
||||||
|
current=$(transmission-remote -t 1 -i | grep -i location | awk '{print $2}')
|
||||||
|
|
||||||
|
choice=$(printf '%s\n' "${paths[@]}" | dmenu -p "Current: $current")
|
||||||
|
|
||||||
|
[ -z "$choice" ] && quick-notify "Transmission" "No path chosen" && exit
|
||||||
|
|
||||||
|
[ ! -d "$choice" ] && mkdir -p "$choice"
|
||||||
|
|
||||||
|
if transmission-remote -t $1 --move $choice ; then
|
||||||
|
quick-notify "Transmission" "Moved $1 to $choice"
|
||||||
|
else
|
||||||
|
quick-notify "Transmission" "Couldn't move $1 to $choice"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$(printf "Start\\nStop\\nMove\\nRemove" | dmenu -p "Torrent Action: ")" in
|
||||||
|
Remove) transmission-remote -t $id -r
|
||||||
|
quick-notify "Transmission" "Removed $id"
|
||||||
|
;;
|
||||||
|
Start) transmission-remote -t $id -s
|
||||||
|
quick-notify "Transmission" "Started $id"
|
||||||
|
;;
|
||||||
|
Stop) transmission-remote -t $id -S
|
||||||
|
quick-notify "Transmission" "Stoped $id"
|
||||||
|
;;
|
||||||
|
Move) move $id
|
||||||
|
;;
|
||||||
|
*) quick-notify "Transmission" "No action chosen"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user