mirror of
https://github.com/nix-community/home-manager
synced 2024-12-26 19:59:47 +01:00
hyprland: improve config reload
When using the previous approach I've always gotten errors that I can't reload config on the .lock file that exists in /tmp when you run a standard configured hyprland. This commit improves this by using hyprctl to find instances to reload instead. We can remove the HYPRLAND_INSTANCE_SIGNATURE bogus assignment once https://github.com/hyprwm/Hyprland/issues/4088 is resolved. Co-authored-by: Carl Hjerpe <git@hjerpe.xyz>
This commit is contained in:
parent
3d480fe009
commit
14dd7d71fb
1 changed files with 5 additions and 5 deletions
|
@ -243,11 +243,11 @@ in {
|
||||||
+ lib.optionalString (cfg.extraConfig != "") cfg.extraConfig;
|
+ lib.optionalString (cfg.extraConfig != "") cfg.extraConfig;
|
||||||
|
|
||||||
onChange = lib.mkIf (cfg.package != null) ''
|
onChange = lib.mkIf (cfg.package != null) ''
|
||||||
( # execute in subshell so that `shopt` won't affect other scripts
|
( # Execute in subshell so we don't poision environment with vars
|
||||||
shopt -s nullglob # so that nothing is done if /tmp/hypr/ does not exist or is empty
|
# This var must be set for hyprctl to function, but the value doesn't matter.
|
||||||
for instance in /tmp/hypr/*; do
|
export HYPRLAND_INSTANCE_SIGNATURE="bogus"
|
||||||
HYPRLAND_INSTANCE_SIGNATURE=''${instance##*/} ${cfg.finalPackage}/bin/hyprctl reload config-only \
|
for i in $(${cfg.finalPackage}/bin/hyprctl instances -j | jq ".[].instance" -r); do
|
||||||
|| true # ignore dead instance(s)
|
HYPRLAND_INSTANCE_SIGNATURE=$i ${cfg.finalPackage}/bin/hyprctl reload config-only
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue