actually, just use pidof
This commit is contained in:
parent
3e88424b5d
commit
d8f0865799
3 changed files with 6 additions and 7 deletions
|
@ -4,8 +4,6 @@
|
|||
killall -q polybar
|
||||
|
||||
# Wait until the processes have been shut down
|
||||
while ps ax | grep -q "\spolybar$"; do sleep 1; done
|
||||
while pidof polybar >/dev/null; do sleep 1; done
|
||||
|
||||
for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar default & done
|
||||
|
||||
echo "Bars launched..."
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
# If transmission-daemon is running, will ask to kill, else will ask to start.
|
||||
if ps ax | grep -q "\stransmission-daemon$" ;
|
||||
|
||||
if pidof transmission-daemon >/dev/null ;
|
||||
then
|
||||
[ "$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon killed."
|
||||
[ "$(printf "No\\nYes" | dmenu -i -p "Turn off transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon disabled."
|
||||
else
|
||||
ifinstalled transmission-cli || exit
|
||||
[ "$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon started."
|
||||
[ "$(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}"
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
|
||||
# transmission-daemon sometimes fails to take remote requests in its first moments, hence the sleep.
|
||||
|
||||
ps ax | grep -q "\stransmission-daemon$" || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}") &
|
||||
pidof transmission-daemon >/dev/null || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}") &
|
||||
|
||||
transmission-remote -a "$@" && notify-send "🔽 Torrent added."
|
||||
|
|
Loading…
Reference in a new issue