fix(home): match wrapped waybar comm when killing bar on monitor change

`pkill -x waybar` matched only comm `waybar`, but the home-manager
wrapper launches the bar with comm `.waybar-wrapped` (arg[0] still
`waybar`), so the kill missed and left a stale bar drawing on the old
geometry after an unplug. Match both comms via an anchored ERE in both
the `monitor-hotplug` handler and `swapMonitors`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-22 19:16:44 +02:00
co-authored by Claude Opus 4.8
parent 102fb3c3c4
commit 38556c8839
2 changed files with 12 additions and 5 deletions
+5 -2
View File
@@ -115,8 +115,11 @@ let
| "keyword monitor \($l.name),preferred,0x0,\($l.scale)"
+ " ; keyword monitor \($r.name),preferred,\($off)x0,\($r.scale)"')
"$hc" --batch "$cmd"
# re-anchor the layer-shell clients onto the new geometry (see comment above)
${pkgs.procps}/bin/pkill -USR2 -x .waybar-wrapped || true
# re-anchor the layer-shell clients onto the new geometry (see comment above).
# Anchored ERE covers both comms: the wrapper-launched bar (comm
# `.waybar-wrapped`) and one the monitor-hotplug handler relaunched via
# `hyprctl dispatch exec waybar` (comm `waybar`).
${pkgs.procps}/bin/pkill -USR2 -x '\.waybar-wrapped|waybar' || true
bg="$HOME/.local/share/bg"
[ -e "$bg" ] && ${pkgs.awww}/bin/awww img "$bg" || true
'';