Skip to content

Commit 7946193

Browse files
hyprland: load plugins using exec-once (#6789)
Should eliminate crashes / plugin version mismatches when updating hyprland.
1 parent 542efdf commit 7946193

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

modules/services/window-managers/hyprland.nix

+3-2
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,13 @@ in
287287
plugins:
288288
lib.hm.generators.toHyprconf {
289289
attrs = {
290-
plugin =
290+
"exec-once" =
291291
let
292292
mkEntry =
293293
entry: if lib.types.package.check entry then "${entry}/lib/lib${entry.pname}.so" else entry;
294+
hyprctl = "${cfg.finalPackage}/bin/hyprctl";
294295
in
295-
map mkEntry cfg.plugins;
296+
map (p: "${hyprctl} plugin load ${mkEntry p}") cfg.plugins;
296297
};
297298
inherit (cfg) importantPrefixes;
298299
};

tests/modules/services/window-managers/hyprland/multiple-devices-config.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
exec-once = @dbus@/bin/dbus-update-activation-environment --systemd DISPLAY HYPRLAND_INSTANCE_SIGNATURE WAYLAND_DISPLAY XDG_CURRENT_DESKTOP && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target
2-
plugin=/path/to/plugin1
3-
plugin=/nix/store/00000000000000000000000000000000-foo/lib/libfoo.so
2+
exec-once=/nix/store/00000000000000000000000000000000-hyprland/bin/hyprctl plugin load /path/to/plugin1
3+
exec-once=/nix/store/00000000000000000000000000000000-hyprland/bin/hyprctl plugin load /nix/store/00000000000000000000000000000000-foo/lib/libfoo.so
44
$mod=SUPER
55
bezier=smoothOut, 0.36, 0, 0.66, -0.56
66
bezier=smoothIn, 0.25, 1, 0.5, 1

tests/modules/services/window-managers/hyprland/simple-config.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
exec-once = @dbus@/bin/dbus-update-activation-environment --systemd DISPLAY HYPRLAND_INSTANCE_SIGNATURE WAYLAND_DISPLAY XDG_CURRENT_DESKTOP && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target
2-
plugin=/path/to/plugin1
3-
plugin=/nix/store/00000000000000000000000000000000-foo/lib/libfoo.so
2+
exec-once=/nix/store/00000000000000000000000000000000-hyprland/bin/hyprctl plugin load /path/to/plugin1
3+
exec-once=/nix/store/00000000000000000000000000000000-hyprland/bin/hyprctl plugin load /nix/store/00000000000000000000000000000000-foo/lib/libfoo.so
44
$mod=SUPER
55
bezier=smoothOut, 0.36, 0, 0.66, -0.56
66
bezier=smoothIn, 0.25, 1, 0.5, 1

0 commit comments

Comments
 (0)