nwg-panel: fix multiple instances on display change

This commit is contained in:
2024-07-13 21:00:58 +00:00
parent f6895393d9
commit d0b5f586c4

View File

@@ -147,7 +147,6 @@ in
suggestedPrograms = [ suggestedPrograms = [
"brightnessctl" "brightnessctl"
"pactl" # pactl required by `per-app-volume` component. "pactl" # pactl required by `per-app-volume` component.
"sane-die-with-parent"
] ++ lib.optionals (cfg.config.torch != null) [ ] ++ lib.optionals (cfg.config.torch != null) [
"torch-toggle" "torch-toggle"
]; ];
@@ -205,6 +204,7 @@ in
"/sys/devices" "/sys/devices"
]; ];
sandbox.extraRuntimePaths = [ "sway" ]; sandbox.extraRuntimePaths = [ "sway" ];
sandbox.isolatePids = false; #< nwg-panel restarts itself on display dis/connect, by killing all other instances.
services.nwg-panel = { services.nwg-panel = {
description = "nwg-panel status/topbar for wayland"; description = "nwg-panel status/topbar for wayland";
@@ -214,7 +214,7 @@ in
# N.B.: G_MESSAGES_DEBUG=all causes the swaync icon to not render # N.B.: G_MESSAGES_DEBUG=all causes the swaync icon to not render
# command = "env G_MESSAGES_DEBUG=all nwg-panel"; # command = "env G_MESSAGES_DEBUG=all nwg-panel";
# XXX: try `nwg-panel & ; kill $$`. the inner nwg-panel doesn't die (without sane-die-with-parent), and hence the service would be prone to maintaining _multiple_ bars. # XXX: try `nwg-panel & ; kill $$`. the inner nwg-panel doesn't die (without sane-die-with-parent), and hence the service would be prone to maintaining _multiple_ bars.
command = "sane-die-with-parent --descendants --signal SIGKILL nwg-panel"; command = "nwg-panel";
}; };
}; };
} }