summaryrefslogtreecommitdiff
path: root/common/home/hyprland/hl.nix
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2026-06-07 21:10:38 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2026-06-07 21:11:15 +0200
commitc643862bfee0debaf1c5110e732adc8c69cdb203 (patch)
tree72efc189f659931ed385d7e51ef966f00577bd48 /common/home/hyprland/hl.nix
parent64c9728e0c73e35787b2e69393a69c9d2815f936 (diff)
update to nixos 26.05
Diffstat (limited to 'common/home/hyprland/hl.nix')
-rw-r--r--common/home/hyprland/hl.nix38
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";
+ };
+ };
+}