diff --git a/.config/i3/config b/.config/i3/config index 13665de..80423df 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -13,7 +13,7 @@ set $mod2 Mod1 floating_modifier $mod # Application startup -exec_always --no-startup-id "pkill lemonbar.sh; $HOME/.scripts/panel/lemonbar.sh &" +exec_always --no-startup-id $HOME/.scripts/panel/lemonbar.sh & exec_always --no-startup-id $HOME/.scripts/wm/wallpaper.sh & exec --no-startup-id firefox exec --no-startup-id urxvt diff --git a/.scripts/panel/lemonbar.sh b/.scripts/panel/lemonbar.sh index 6a75a91..cb9a767 100755 --- a/.scripts/panel/lemonbar.sh +++ b/.scripts/panel/lemonbar.sh @@ -36,11 +36,10 @@ bar() { } start() { - # Exit if panel is already running - if [ "$(pgrep lemonbar | awk 'END {print FNR}')" -gt "2" ]; then - printf "%s\n" "The panel is already running." >&2 - exit 1 - fi + # Kill existing panel + while [ "$(pgrep -cx lemonbar.sh)" -gt 1 ]; do + pkill -ox -9 lemonbar.sh; + done # Trap all subshells trap 'trap - TERM; kill 0' INT TERM QUIT EXIT