dotfiles

My dotfiles used for LARBS
Log | Files | Refs | Submodules | README | LICENSE

commit d8f0865799d3641a2f458f8025ef788cc7d7c518
parent 3e88424b5dc92b34c1cf325a7af5c96e5180e774
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Mon, 13 Apr 2020 11:49:40 -0400

actually, just use pidof

Diffstat:
M.local/bin/launch_polybar | 4+---
M.local/bin/td-toggle | 7++++---
M.local/bin/transadd | 2+-
3 files changed, 6 insertions(+), 7 deletions(-)

diff --git 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 @@ -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 @@ -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."