scripts/watch-magnets.sh

5 lines
419 B
Bash
Executable File

# command -v notify-send 1>/dev/null || echo "The \"notify-send\" command is not available. Aborting." && exit 1
SAVEDIR=$(xdg-user-dir DOWNLOAD)
[[ "$1" =~ ^magnet ]] && notify-send -a "Clipboard Watcher" "Magnet URL copied to the clipboard."
aria2c -d "$SAVEDIR" --input-file <( echo "$1" ) --bt-metadata-only=true --bt-save-metadata=true
# TODO: spawn aria2c in a subshell in case a magnet link takes forever to load