{ 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"; }; }; }