summaryrefslogtreecommitdiffstats
path: root/.scripts
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2018-10-04 13:45:00 -0400
committerLuke Smith <luke@lukesmith.xyz>2018-10-04 13:45:00 -0400
commitcb5834b54bb6e590ae1b7400e84fdd0aad724dac (patch)
treeb7adce61a965656da04287abf81ce563ecea72ee /.scripts
parent19623c874123f286f0bf084e40e93fd386a4569f (diff)
downloadeibhear-cb5834b54bb6e590ae1b7400e84fdd0aad724dac.tar.gz
eibhear-cb5834b54bb6e590ae1b7400e84fdd0aad724dac.tar.zst
eibhear-cb5834b54bb6e590ae1b7400e84fdd0aad724dac.zip
transadd script added
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/transadd12
1 files changed, 12 insertions, 0 deletions
diff --git a/.scripts/transadd b/.scripts/transadd
new file mode 100755
index 0000000..782f67a
--- /dev/null
+++ b/.scripts/transadd
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Mimeapp script for adding torrent to transmission-daemon, but will also start
+# the daemon first if not running.
+
+# Optionally requires my `note` script. The sleep of 3 seconds is because the
+# transmission-daemon sometimes fails to take remote requests in its first
+# moments.
+
+pgrep -x transmission-da || (transmission-daemon && note "Starting daemon..." && sleep 3 && pkill -RTMIN+7 i3blocks)
+
+transmission-remote -a "$@" && note "Torrent added."