voidrice/.local/bin/td-toggle
anntnzrb 636c35a126 Use pkill instead of killall
The `killall` command doesn't come shipped in all distributions (Void
Linux as an example), on the other hand `pkill` does.

Unsure what the exact intention on each call is but the `-9` signal can be
replaced with `-x` if the intention is not to end all instances.

Also note that I left `pkill -x Xorg` without the `-9` signal because
for some reason it won't function as expected and end up halting the
system (at least on Void Linux).
2020-07-31 12:25:28 -05:00

13 lines
542 B
Bash
Executable File

#!/bin/sh
# If transmission-daemon is running, will ask to kill, else will ask to start.
if pidof transmission-daemon >/dev/null ;
then
[ "$(printf "No\\nYes" | dmenu -i -p "Turn off transmission-daemon?")" = "Yes" ] && pkill -9 transmission-da && notify-send "transmission-daemon disabled."
else
ifinstalled transmission-cli || exit
[ "$(printf "No\\nYes" | dmenu -i -p "Turn on transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon enabled."
fi
sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}"