# Small helpers for writing the Hyprland Lua config through home-manager's `settings` {lib}: rec { inherit (lib.generators) mkLuaInline; toLua = lib.generators.toLua {}; # hl.dsp.exec_cmd("...") exec = cmd: mkLuaInline "hl.dsp.exec_cmd(${toLua cmd})"; # hl.bind(keys, dispatcher, opts?) bind = keys: dsp: opts: { _args = [keys dsp] ++ lib.optional (opts != null) opts; }; # Run commands once at compositor start (replacement for `exec-once`) execOnce = cmds: [ { _args = [ "hyprland.start" (mkLuaInline '' function() ${lib.concatMapStrings (c: " hl.exec_cmd(${toLua c})\n") cmds}end'') ]; } ]; }