diff options
Diffstat (limited to 'common/home/hyprland/hl.nix')
| -rw-r--r-- | common/home/hyprland/hl.nix | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/common/home/hyprland/hl.nix b/common/home/hyprland/hl.nix new file mode 100644 index 0000000..fb2565d --- /dev/null +++ b/common/home/hyprland/hl.nix @@ -0,0 +1,38 @@ +{ lib }: let + Lua = lib.generators.mkLuaInline; + toLua = lib.generators.toLua; + join = builtins.concatStringsSep; + call = name: opts: (Lua "${name}(${if opts == null then "" else (toLua {} opts)})"); +in +{ + bind = { mod ? false, shift ? false, keys, flags ? null }: lua: { + _args = [ + (Lua ( + (if mod then "mod .. ' + " else "'") + + (if shift then "SHIFT + " else "") + + (join " + " keys) + "'") + ) + lua + flags + ]; + }; + on.start = luas: { + _args = [ + "hyprland.start" + (Lua "function()${join ";" (map (l: l.expr) luas)}end") + ]; + }; + dsp = { + exec = call "hl.dsp.exec_cmd"; + exit = call "hl.dsp.exit" null; + focus = call "hl.dsp.focus"; + layout = call "hl.dsp.layout"; + window = { + drag = call "hl.dsp.window.drag" null; + move = call "hl.dsp.window.move"; + close = call "hl.dsp.window.close" null; + fullscreen = call "hl.dsp.window.fullscreen" null; + resize = call "hl.dsp.window.resize"; + }; + }; +} |