ft: hyprland to home manager

This commit is contained in:
2026-10-02 01:57:43 +02:00
parent 0e3a6b116d
commit 37fb63549e
5 changed files with 14 additions and 11 deletions

View File

@@ -27,7 +27,7 @@ rec {
bindm = keys: dispatcher: desc: bindWith {description = desc; mouse = true;} keys dispatcher; bindm = keys: dispatcher: desc: bindWith {description = desc; mouse = true;} keys dispatcher;
exec = cmd: "hl.dsp.exec_cmd(${str cmd})"; exec = cmd: "hl.dsp.exec_cmd(${str cmd})";
mulexec = cmds: "function() ${lib.concatMapStringsSep " " (cmd: "hl.dsp.exec_cmd(${str cmd})") cmds} end"; muldsp = dsps: "function()\n ${lib.concatMapStringsSep "\n " (dsp: "hl.dispatch(${dsp})") dsps}\n end";
pass = window: "hl.dsp.pass({ window = ${str window}})"; pass = window: "hl.dsp.pass({ window = ${str window}})";
submap = name: "hl.dsp.submap(${str name})"; submap = name: "hl.dsp.submap(${str name})";

View File

@@ -3,10 +3,11 @@
let let
inherit (hyprLib) inherit (hyprLib)
bind bind
makeSubmap
muldsp
pass pass
sendShortcut sendShortcut
submap submap
makeSubmap
; ;
makePassthrough = window: binds: makePassthrough = window: binds:
@@ -17,7 +18,7 @@ let
v = builtins.elemAt mapping 1; v = builtins.elemAt mapping 1;
d = if builtins.length mapping >= 3 then builtins.elemAt mapping 2 else ""; d = if builtins.length mapping >= 3 then builtins.elemAt mapping 2 else "";
in in
[k (sendShortcut v window) d] [k (muldsp [(sendShortcut v window) (submap "reset")]) d]
) binds; ) binds;
in in
customBinds ++ [["ESCAPE" (submap "reset")]]; customBinds ++ [["ESCAPE" (submap "reset")]];

View File

@@ -6,6 +6,7 @@ let
exec exec
submap submap
makeSubmap makeSubmap
muldsp
; ;
systemModeName = " l e s h r ^s"; systemModeName = " l e s h r ^s";
@@ -19,10 +20,10 @@ in
define_submap = [ define_submap = [
(makeSubmap systemModeName [ (makeSubmap systemModeName [
["L" (exec "${exitScript} lock") "Lock the machine"] ["L" (muldsp [(exec "${exitScript} lock") (submap "reset")]) "Lock the machine"]
["E" (exec "${exitScript} logout") "Log out"] ["E" (muldsp [(exec "${exitScript} logout") (submap "reset")]) "Log out"]
["S" (exec "${exitScript} suspend") "Suspend the machine"] ["S" (muldsp [(exec "${exitScript} suspend") (submap "reset")]) "Suspend the machine"]
["H" (exec "${exitScript} hibernate") "Hibernate the machine"] ["H" (muldsp [(exec "${exitScript} hibernate") (submap "reset")]) "Hibernate the machine"]
["R" (exec "${exitScript} reboot") "Reboot the machine"] ["R" (exec "${exitScript} reboot") "Reboot the machine"]
["SHIFT + S" (exec "${exitScript} shutdown") "Power the machine off"] ["SHIFT + S" (exec "${exitScript} shutdown") "Power the machine off"]
["ESCAPE" (submap "reset") "Return to default mode"] ["ESCAPE" (submap "reset") "Return to default mode"]

View File

@@ -3,6 +3,7 @@
let let
inherit (hyprLib) inherit (hyprLib)
bind bind
muldsp
focusWorkspace focusWorkspace
moveWorkspace moveWorkspace
submap submap
@@ -29,7 +30,7 @@ in
] ++ builtins.concatLists (builtins.genList (i: ] ++ builtins.concatLists (builtins.genList (i:
let ws = i+10; let ws = i+10;
in [ in [
[(toString i) (focusWorkspace ws) ""] [(toString i) (muldsp [(focusWorkspace ws) (submap "reset")]) ""]
["SHIFT + ${toString i}" (moveWorkspace ws false)] ["SHIFT + ${toString i}" (moveWorkspace ws false)]
]) 9)))]; ]) 9)))];

View File

@@ -4,7 +4,7 @@ let
inherit (hyprLib) inherit (hyprLib)
bind bind
exec exec
mulexec muldsp
; ;
in in
{ {
@@ -14,8 +14,8 @@ in
(bind "XF86AudioMute" (exec "pactl set-sink-mute @DEFAULT_SINK@ toggle") "Toggle mute using XF86 keys") (bind "XF86AudioMute" (exec "pactl set-sink-mute @DEFAULT_SINK@ toggle") "Toggle mute using XF86 keys")
(bind "XF86AudioMicMute" (exec "pactl set-source-mute @DEFAULT_SOURCE@ toggle ") "Toggle microphone mute using XF86 keys") (bind "XF86AudioMicMute" (exec "pactl set-source-mute @DEFAULT_SOURCE@ toggle ") "Toggle microphone mute using XF86 keys")
(bind "XF86MonBrightnessUp" (mulexec ["brightnessctl set +10%" "~/.config/WMScripts/backlight-notif.sh"]) "Increase screen brightness using XF86 keys") (bind "XF86MonBrightnessUp" (muldsp [(exec "brightnessctl set +10%") (exec "~/.config/WMScripts/backlight-notif.sh")]) "Increase screen brightness using XF86 keys")
(bind "XF86MonBrightnessDown" (mulexec ["brightnessctl set 10%-" "~/.config/WMScripts/backlight-notif.sh"]) "Decrease screen brightness using XF86 keys") (bind "XF86MonBrightnessDown" (muldsp [(exec "brightnessctl set 10%-") (exec "~/.config/WMScripts/backlight-notif.sh")]) "Decrease screen brightness using XF86 keys")
]; ];
} }