dotfiles
Seven years worth of accumulated configuration cruft
dotfiles/scripts/.local/bin/torrent-add
Download raw file: scripts/.local/bin/torrent-add
#!/bin/sh # Default handler for magnet links # Called by ~/.local/share/applications/{torrent.desktop, mimeapps.list} # Depends on transmission-cli, notify-send, and dunst set -eu msg() { printf "Torrent Handler: %s\n" "$1" command -v notify-send >/dev/null && \ notify-send "🌱 Torrent Handler" "$1" } pgrep transmission >/dev/null || { transmission-daemon -w ~/temporary && \ msg "Starting transmission daemon..." } [ "$#" -gt 0 ] && { transmission-remote -a "$1" -e "$XDG_CACHE_HOME"/transmission-da.log case "$?" in 0) msg "Added $1" ;; *) msg "Failed: Unable to Add Torrent." ;; esac } printf "Web interface is running on http://localhost:9091\n"