diff --git a/bin/omarchy-refresh-waybar b/bin/omarchy-refresh-waybar index 43eec3d..7dfae19 100755 --- a/bin/omarchy-refresh-waybar +++ b/bin/omarchy-refresh-waybar @@ -4,4 +4,4 @@ omarchy-refresh-config waybar/config.jsonc omarchy-refresh-config waybar/style.css # Restart waybar -pkill -SIGUSR2 waybar +omarchy-restart-waybar diff --git a/bin/omarchy-restart-waybar b/bin/omarchy-restart-waybar new file mode 100755 index 0000000..8d113bd --- /dev/null +++ b/bin/omarchy-restart-waybar @@ -0,0 +1,4 @@ +#!/bin/bash + +killall waybar || true +setsid uwsm app -- waybar &>/dev/null & diff --git a/bin/omarchy-theme-set b/bin/omarchy-theme-set index 03baae4..791fc0d 100755 --- a/bin/omarchy-theme-set +++ b/bin/omarchy-theme-set @@ -44,7 +44,7 @@ touch "$HOME/.config/alacritty/alacritty.toml" # Restart components to apply new theme pkill -SIGUSR2 btop -pkill -SIGUSR2 waybar +"$HOME/.local/share/omarchy/bin/omarchy-restart-waybar" pkill swayosd-server setsid uwsm app -- swayosd-server &>/dev/null & makoctl reload diff --git a/config/hypr/hypridle.conf b/config/hypr/hypridle.conf index e607bda..a7eaaf1 100644 --- a/config/hypr/hypridle.conf +++ b/config/hypr/hypridle.conf @@ -2,7 +2,7 @@ general { lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. before_sleep_cmd = loginctl lock-session # lock before suspend. after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. - on_unlock_cmd = pkill -SIGUSR2 waybar # prevent stacking of waybar when waking + on_unlock_cmd = omarchy-restart-waybar # prevent stacking of waybar when waking } listener { diff --git a/migrations/1751225707.sh b/migrations/1751225707.sh index 7c9896c..1638777 100644 --- a/migrations/1751225707.sh +++ b/migrations/1751225707.sh @@ -2,5 +2,5 @@ echo "Fixing persistent workspaces in waybar config" if [[ -f ~/.config/waybar/config ]]; then sed -i 's/"persistent_workspaces":/"persistent-workspaces":/' ~/.config/waybar/config - pkill -SIGUSR2 waybar + omarchy-restart-waybar fi diff --git a/migrations/1754113760.sh b/migrations/1754113760.sh new file mode 100644 index 0000000..f66c1a4 --- /dev/null +++ b/migrations/1754113760.sh @@ -0,0 +1,10 @@ +echo "Change reload Waybar on unlock command to prevent stacking" + +if ! grep -q 'on_unlock_cmd *= *omarchy-restart-waybar' ~/.config/hypr/hypridle.conf; then + sed -i \ + '/^ on_unlock_cmd = pkill -SIGUSR2 waybar[[:space:]]*# prevent stacking of waybar when waking$/c\ + on_unlock_cmd = omarchy-restart-waybar # prevent stacking of waybar when waking' \ + ~/.config/hypr/hypridle.conf + + omarchy-restart-waybar +fi