diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2020-04-11 10:03:33 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2020-04-11 10:03:33 -0400 |
| commit | 080365dd22b967274833f50a5cd0cccc0790a658 (patch) | |
| tree | ac187a4c8e8d29a34092e64ed0650d6c79ee35bc /.local/bin/transadd | |
| parent | 7b9277ae0b061af6890786a9149b7e26aa380e2b (diff) | |
| download | eibhear-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/transadd | 4 |
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." |
