summaryrefslogtreecommitdiffstats
path: root/.local/bin/transadd
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-04-11 10:03:33 -0400
committerLuke Smith <luke@lukesmith.xyz>2020-04-11 10:03:33 -0400
commit080365dd22b967274833f50a5cd0cccc0790a658 (patch)
treeac187a4c8e8d29a34092e64ed0650d6c79ee35bc /.local/bin/transadd
parent7b9277ae0b061af6890786a9149b7e26aa380e2b (diff)
downloadeibhear-080365dd22b967274833f50a5cd0cccc0790a658.tar.gz
eibhear-080365dd22b967274833f50a5cd0cccc0790a658.tar.zst
eibhear-080365dd22b967274833f50a5cd0cccc0790a658.zip
pgrep is a little slow, slower than ps | grep
Diffstat (limited to '.local/bin/transadd')
-rwxr-xr-x.local/bin/transadd4
1 files changed, 2 insertions, 2 deletions
diff --git a/.local/bin/transadd b/.local/bin/transadd
index 97ffafc..a2e080d 100755
--- a/.local/bin/transadd
+++ b/.local/bin/transadd
@@ -2,8 +2,8 @@
# Mimeapp script for adding torrent to transmission-daemon, but will also start the daemon first if not running.
-# transmission-daemon sometimes fails to take remote requests in its first moments.
+# transmission-daemon sometimes fails to take remote requests in its first moments, hence the sleep.
-pgrep -x transmission-da || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}")
+ps ax | grep -q "\stransmission-daemon$" || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}") &
transmission-remote -a "$@" && notify-send "🔽 Torrent added."