diff options
| author | Andrew <saintruler@gmail.com> | 2021-05-22 10:59:18 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2021-05-22 10:59:18 +0400 |
| commit | 3fe571af76bef57861103e3da5df8c913ad13c33 (patch) | |
| tree | 4c4687cc311bdef733cbcba23bc15ccdb1bba66b | |
| parent | c5446fd696c30537ef00b16577ced4df288852db (diff) | |
Added more flexible config for opening transmission client for different servers
| -rw-r--r-- | .config/sxhkd/sxhkdrc | 2 | ||||
| -rw-r--r-- | .config/systemd/user/transmission.service | 12 | ||||
| -rw-r--r-- | .config/transmission-daemon/settings.sample.json | 68 | ||||
| -rwxr-xr-x | .local/bin/scripts/transadd | 25 | ||||
| -rwxr-xr-x | .local/bin/scripts/transopen | 20 |
5 files changed, 116 insertions, 11 deletions
diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 6bbee83..90b1c7b 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -49,7 +49,7 @@ super + Tab sh -c "$TERMINAL -e htop" super + shift + t - sh -c "$TERMINAL -e tremc" + sh -c "$TERMINAL -e transopen" super + m sh -c "$TERMINAL -e music localhost" diff --git a/.config/systemd/user/transmission.service b/.config/systemd/user/transmission.service new file mode 100644 index 0000000..dbfa101 --- /dev/null +++ b/.config/systemd/user/transmission.service @@ -0,0 +1,12 @@ +[Unit] +Description=Transmission BitTorrent Daemon +After=network.target + +[Service] +Type=notify +ExecStart=/usr/bin/transmission-daemon -f --log-error +ExecReload=/bin/kill -s HUP $MAINPID +NoNewPrivileges=true + +[Install] +WantedBy=multi-user.target diff --git a/.config/transmission-daemon/settings.sample.json b/.config/transmission-daemon/settings.sample.json new file mode 100644 index 0000000..2ea1366 --- /dev/null +++ b/.config/transmission-daemon/settings.sample.json @@ -0,0 +1,68 @@ +{ + "alt-speed-down": 50, + "alt-speed-enabled": false, + "alt-speed-time-begin": 540, + "alt-speed-time-day": 127, + "alt-speed-time-enabled": false, + "alt-speed-time-end": 1020, + "alt-speed-up": 50, + "bind-address-ipv4": "0.0.0.0", + "bind-address-ipv6": "::", + "blocklist-enabled": false, + "blocklist-url": "http://www.example.com/blocklist", + "cache-size-mb": 4, + "dht-enabled": true, + "download-dir": "/home/user/downloads", + "download-queue-enabled": true, + "download-queue-size": 5, + "encryption": 1, + "idle-seeding-limit": 30, + "idle-seeding-limit-enabled": false, + "incomplete-dir": "/home/user/downloads", + "incomplete-dir-enabled": false, + "lpd-enabled": false, + "message-level": 1, + "peer-congestion-algorithm": "", + "peer-id-ttl-hours": 6, + "peer-limit-global": 200, + "peer-limit-per-torrent": 50, + "peer-port": 51413, + "peer-port-random-high": 65535, + "peer-port-random-low": 49152, + "peer-port-random-on-start": false, + "peer-socket-tos": "default", + "pex-enabled": true, + "port-forwarding-enabled": true, + "preallocation": 1, + "prefetch-enabled": true, + "queue-stalled-enabled": true, + "queue-stalled-minutes": 30, + "ratio-limit": 2, + "ratio-limit-enabled": false, + "rename-partial-files": true, + "rpc-authentication-required": false, + "rpc-bind-address": "0.0.0.0", + "rpc-enabled": true, + "rpc-host-whitelist": "localhost", + "rpc-host-whitelist-enabled": true, + "rpc-password": "password", + "rpc-port": 9091, + "rpc-url": "/transmission/", + "rpc-username": "user", + "rpc-whitelist": "127.0.0.1", + "rpc-whitelist-enabled": true, + "scrape-paused-torrents-enabled": true, + "script-torrent-done-enabled": false, + "script-torrent-done-filename": "", + "seed-queue-enabled": false, + "seed-queue-size": 10, + "speed-limit-down": 100, + "speed-limit-down-enabled": false, + "speed-limit-up": 100, + "speed-limit-up-enabled": false, + "start-added-torrents": true, + "trash-original-torrent-files": false, + "umask": 18, + "upload-slots-per-torrent": 14, + "utp-enabled": true +} diff --git a/.local/bin/scripts/transadd b/.local/bin/scripts/transadd index 9ec01a9..5ab3f24 100755 --- a/.local/bin/scripts/transadd +++ b/.local/bin/scripts/transadd @@ -1,17 +1,22 @@ #!/bin/sh -# Local paths -# directories="/home/andrew/Downloads -# /home/andrew/Videos/Movies -# /home/andrew/Videos/Series" +hosts="raspberry +localhost" -# Paths on remote server -directories="/var/lib/transmission-daemon/downloads/Movies -/var/lib/transmission-daemon/downloads/Series -/var/lib/transmission-daemon/downloads" +host=$(printf "$hosts" | dmenu -p "Choose host" -i -l 5) -host=$(pass Services/transmission/rpi-host) -creds=$(pass Services/transmission/rpi-creds) +case $host in + localhost) + host="localhost" + creds="" + directories="$HOME/downloads" ;; + raspberry) + host=$(pass Services/transmission/rpi-host) + creds=$(pass Services/transmission/rpi-creds) + directories="/var/lib/transmission-daemon/downloads/Movies +/var/lib/transmission-daemon/downloads/Series +/var/lib/transmission-daemon/downloads" ;; +esac dest=$(printf "$directories" | dmenu -p "Choose destination" -i -l 5) transmission-remote $host -n $creds -a "$@" -w "$dest" && notify-send "Torrent added" diff --git a/.local/bin/scripts/transopen b/.local/bin/scripts/transopen new file mode 100755 index 0000000..3897ef0 --- /dev/null +++ b/.local/bin/scripts/transopen @@ -0,0 +1,20 @@ +#!/bin/sh + +# Possible servers +hosts="raspberry +localhost" + +if [ -z "$1" ]; then + host=$(printf "$hosts" | fzf +m --reverse) +else + host="$1" +fi + +case $host in + localhost) tremc -c localhost ;; + raspberry) + host=$(pass Services/transmission/rpi-host) + creds=$(pass Services/transmission/rpi-creds) + tremc -c "$creds@$host" ;; +esac + |