feat(hyprland): emit compositor config as lua

This commit is contained in:
alexion committed 2026-10-09 20:12:07 -04:00
1 parent 4908c4751f
commit fce4bdc526
9 files changed
+346 -119

No files matched your search

@@ -6,6 +6,16 @@
}:
# The lock screen: a hyprlock session-lock surface the compositor owns.
let
execBind = key: command: {
_args = [
key
(luaCall "hl.dsp.exec_cmd" [ command ])
];
};
luaCall =
function: args:
lib.generators.mkLuaInline "${function}(${lib.concatMapStringsSep ", " toLua args})";
user = config.user.name;
# The hyprlock this module installs, used by the lock keybind below.
@@ -15,6 +25,7 @@ let
sleepOffIcon = builtins.fromJSON ''"\udb81\udcb3"'';
idleLockToggle = pkgs.writeShellScript "lockscreen-idle-inhibit-toggle" ''
unit=lockscreen-idle-inhibit.service
refresh_waybar() {
@@ -42,6 +53,7 @@ let
${pkgs.swayosd}/bin/swayosd-client --custom-message "${sleepOffIcon}"
fi
'';
toLua = lib.generators.toLua { };
in
{
options.modules.desktop.session.hyprland.hyprlock.enable =
@@ -86,8 +98,8 @@ in
# The guard drops the keypress when a locker is already up, so a second
# hyprlock never stacks over the first.
wayland.windowManager.hyprland.settings.bind = [
"$mod, X, exec, ${pkgs.procps}/bin/pidof hyprlock || ${hyprlock}"
"$mod CTRL, X, exec, ${idleLockToggle}"
(execBind "SUPER + X" "${pkgs.procps}/bin/pidof hyprlock || ${hyprlock}")
(execBind "SUPER + CTRL + X" "${idleLockToggle}")
];
};
};