mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 19:05:58 +01: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
1 changed files with 7 additions and 1 deletions
|
@ -133,7 +133,13 @@ in {
|
||||||
then defaultHyprlandPackage
|
then defaultHyprlandPackage
|
||||||
else cfg.package;
|
else cfg.package;
|
||||||
in
|
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 {
|
systemd.user.targets.hyprland-session = lib.mkIf cfg.systemdIntegration {
|
||||||
|
|
Loading…
Reference in a new issue