mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-09-11 05:15:39 +03:00
nix: handle reloading of multiple/dead instances on home manager generation switch
Signed-off-by: Gaoyang Zhang <gy@blurgy.xyz>
This commit is contained in:
parent
de5e784e07
commit
8a23b66c39
@ -133,7 +133,13 @@ in {
|
||||
then defaultHyprlandPackage
|
||||
else cfg.package;
|
||||
in
|
||||
lib.mkIf (!cfg.disableAutoreload) "HYPRLAND_INSTANCE_SIGNATURE=$(ls -w 1 /tmp/hypr | tail -1) ${hyprlandPackage}/bin/hyprctl reload config-only";
|
||||
lib.mkIf (!cfg.disableAutoreload) ''( # execute in subshell so that `shopt` won't affect other scripts
|
||||
shopt -s nullglob # so that nothing is done if /tmp/hypr/ does not exist or is empty
|
||||
for instance in /tmp/hypr/*; do
|
||||
HYPRLAND_INSTANCE_SIGNATURE=''${instance##*/} ${hyprlandPackage}/bin/hyprctl reload config-only \
|
||||
|| true # ignore dead instance(s)
|
||||
done
|
||||
)'';
|
||||
};
|
||||
|
||||
systemd.user.targets.hyprland-session = lib.mkIf cfg.systemdIntegration {
|
||||
|
Loading…
Reference in New Issue
Block a user