diff --git a/.local/bin/launch_polybar b/.local/bin/launch_polybar index 0af1579..8786be6 100755 --- a/.local/bin/launch_polybar +++ b/.local/bin/launch_polybar @@ -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..." diff --git a/.local/bin/td-toggle b/.local/bin/td-toggle index fb8620f..d2ba76a 100755 --- a/.local/bin/td-toggle +++ b/.local/bin/td-toggle @@ -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}" diff --git a/.local/bin/transadd b/.local/bin/transadd index a2e080d..1b9599e 100755 --- a/.local/bin/transadd +++ b/.local/bin/transadd @@ -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."