From 5e2054b0abe4ef0272f43ca1d78a3af4fe67db28 Mon Sep 17 00:00:00 2001 From: RAPSNX Date: Fri, 28 Aug 2026 14:59:03 +0200 Subject: [PATCH 1/2] feat(hyprland): migrate configuration to lua --- docs/reference/hyprland.md | 5 +- modules/home/desktops/hyprland/default.nix | 137 +++++++------- modules/home/desktops/hyprland/keybinds.nix | 200 ++++++++++---------- 3 files changed, 168 insertions(+), 174 deletions(-) diff --git a/docs/reference/hyprland.md b/docs/reference/hyprland.md index 21b8a7d7..ca2eb9fc 100644 --- a/docs/reference/hyprland.md +++ b/docs/reference/hyprland.md @@ -15,9 +15,12 @@ General docs for hyprland. | `Super+E` | Launcher | | `Super+P` | Noctalia session panel | | `Super+Q` | Kill active | -| `Super+V` | Clipboard history | +| `Alt+V` / `AltGr+V` | Clipboard history | +| `Alt+Shift` | Switch keyboard layout | | `Alt+Tab` | Window switcher | | `Super+N` | Noctalia notification controls | +| `AltGr+C` | Noctalia calendar | +| `AltGr+S` | Noctalia system monitor | | `Super+.` | Noctalia emoji search | ## Window diff --git a/modules/home/desktops/hyprland/default.nix b/modules/home/desktops/hyprland/default.nix index d1394501..7088e8e1 100644 --- a/modules/home/desktops/hyprland/default.nix +++ b/modules/home/desktops/hyprland/default.nix @@ -50,7 +50,7 @@ in wayland.windowManager.hyprland = { enable = true; - configType = "hyprlang"; + configType = "lua"; inherit (cfg) package; @@ -59,75 +59,72 @@ in variables = [ "--all" ]; }; - settings = { - env = [ - "XDG_CURRENT_DESKTOP,Hyprland" - "XDG_SESSION_DESKTOP,Hyprland" - "XDG_SESSION_TYPE,wayland" - ]; - - general = { - gaps_in = 8; - gaps_out = 10; - border_size = 3; - "col.active_border" = "rgba(cba6f7ee) rgba(89b4faee) 45deg"; - "col.inactive_border" = "rgba(585b70aa)"; - }; - - dwindle = { - preserve_split = "yes"; - special_scale_factor = 0.8; - }; - - input = { - kb_layout = "eu,de,de"; - kb_variant = ",neo_qwertz,"; - repeat_rate = 40; - repeat_delay = 250; - accel_profile = "flat"; - sensitivity = 1; - }; - - xwayland = { - force_zero_scaling = true; - }; - - decoration = { - blur = { - enabled = true; - size = 3; - passes = 2; - ignore_opacity = true; - new_optimizations = true; - }; - - rounding = 5; - }; - - exec-once = [ - "[ workspace special:scratchy silent ] alacritty -t scratchy" - # todoist app - "[ workspace special:aux silent ] sleep 2 && chromium --profile-directory=Default --app-id=dlgohinmglaoopaiplliaecdpmnepmga" - ] - ++ cfg.autostart; - - workspace = [ - "1, monitor:desc:Dell Inc. AW2725Q G2QC174, default:true" - "2, monitor:desc:Dell Inc. AW2725Q G2QC174" - "3, monitor:desc:Samsung Electric Company LC27G7xT H4ZNC00167, default:true" - "4, monitor:desc:Samsung Electric Company LC27G7xT H4ZNC00167" - ]; - - windowrule = [ - "match:class ^(firefox)$, workspace 3" - "match:class ^(chromium-browser)$, workspace 4" - - "match:class ^(.*mumble.*)$, workspace special:aux silent" - "match:class ^(.*keepassxc.*)$, workspace special:aux silent" - - "match:class steam, float yes" - "match:class ^(.*nextcloud.*)$, float yes" - ]; + extraLuaFiles = { + "settings" = '' + -- Environment + hl.env("XDG_CURRENT_DESKTOP", "Hyprland") + hl.env("XDG_SESSION_DESKTOP", "Hyprland") + hl.env("XDG_SESSION_TYPE", "wayland") + + -- General, dwindle, input, xwayland, decoration configuration + hl.config({ + general = { + gaps_in = 8, + gaps_out = 10, + border_size = 3, + ["col.active_border"] = "rgba(cba6f7ee) rgba(89b4faee) 45deg", + ["col.inactive_border"] = "rgba(585b70aa)", + }, + dwindle = { + preserve_split = true, + special_scale_factor = 0.8, + }, + input = { + kb_layout = "eu,de,de", + kb_variant = ",neo_qwertz,", + kb_options = "grp:alt_shift_toggle", + repeat_rate = 40, + repeat_delay = 250, + accel_profile = "flat", + sensitivity = 1, + }, + xwayland = { + force_zero_scaling = true, + }, + decoration = { + rounding = 5, + blur = { + enabled = true, + size = 3, + passes = 2, + ignore_opacity = true, + new_optimizations = true, + }, + }, + }) + ''; + + "rules" = '' + -- Workspaces + hl.workspace("1, monitor:desc:Dell Inc. AW2725Q G2QC174, default:true") + hl.workspace("2, monitor:desc:Dell Inc. AW2725Q G2QC174") + hl.workspace("3, monitor:desc:Samsung Electric Company LC27G7xT H4ZNC00167, default:true") + hl.workspace("4, monitor:desc:Samsung Electric Company LC27G7xT H4ZNC00167") + + -- Window rules + hl.windowrule("match:class ^(firefox)$, workspace 3") + hl.windowrule("match:class ^(chromium-browser)$, workspace 4") + hl.windowrule("match:class ^(.*mumble.*)$, workspace special:aux silent") + hl.windowrule("match:class ^(.*keepassxc.*)$, workspace special:aux silent") + hl.windowrule("match:class steam, float yes") + hl.windowrule("match:class ^(.*nextcloud.*)$, float yes") + ''; + + "autostart" = '' + hl.exec_once("[ workspace special:scratchy silent ] alacritty -t scratchy") + hl.exec_once("[ workspace special:aux silent ] sleep 2 && chromium --profile-directory=Default --app-id=dlgohinmglaoopaiplliaecdpmnepmga") + ${lib.concatMapStringsSep "\n" (cmd: "hl.exec_once(\"${cmd}\")") cfg.autostart} + ''; }; }; } diff --git a/modules/home/desktops/hyprland/keybinds.nix b/modules/home/desktops/hyprland/keybinds.nix index 18d52c44..e3567cf5 100644 --- a/modules/home/desktops/hyprland/keybinds.nix +++ b/modules/home/desktops/hyprland/keybinds.nix @@ -30,108 +30,102 @@ let in { config = lib.mkIf cfg.enable { - wayland.windowManager.hyprland.settings = { - bind = [ - # Common - "SUPER,RETURN, exec, alacritty" - "SUPER,E, exec, noctalia msg panel-toggle launcher" - "SUPER,P, exec, noctalia msg panel-toggle session" - "SUPER,Q, killactive" - "SUPER,V, exec, noctalia msg panel-toggle clipboard" - "ALT,TAB, exec, noctalia msg window-switcher" - - # Notification center - "SUPER,N, exec, noctalia msg panel-toggle control-center notifications" - - # Window actions - "SUPER,F, fullscreen, 1" - "SUPER+SHIFT,F, fullscreen" - - # Movement - "SUPER,H, movefocus, l" - "SUPER,J, movefocus, d" - "SUPER,K, movefocus, u" - "SUPER,L, movefocus, r" - - # Window movement - "SUPER+SHIFT,H, movewindow,l" - "SUPER+SHIFT,J, movewindow, d" - "SUPER+SHIFT,K, movewindow, u" - "SUPER+SHIFT,L, movewindow, r" - - # Layout toggle - "SUPER,T, layoutmsg, togglesplit" - "SUPER,U, togglefloating," - - # Workspace selection - "SUPER,1, workspace, 1" - "SUPER,2, workspace, 2" - "SUPER,3, workspace, 3" - "SUPER,4, workspace, 4" - "SUPER,5, workspace, 5" - - # Workpace handling sratchy - "SUPER,O, togglespecialworkspace, scratchy" - "SUPER,M, togglespecialworkspace, aux" - "SUPER SHIFT,O, movetoworkspace, special:scratchy" - "SUPER SHIFT,M, movetoworkspace, special:aux" - - # -- Programs - # Mumble - "SUPER,Z, exec, mumble rpc togglemute" - "SUPER+SHIFT,Z, exec, mumble rpc toggledeaf" - - # Emoji picker - "SUPER,period, exec, noctalia msg panel-toggle launcher /emo" - - # Reload kanshi - "SUPER+SHIFT,I, exec, systemctl restart --user kanshi.service" - ]; - - extraConfig = '' - # Resize mouse - bindm = SUPER, mouse:272, movewindow - bindm = SUPER, mouse:273, resizewindow - - # Resize mode - bind = SUPER, R, submap, resize - submap = resize - bind = , H, resizeactive, -60 0 - bind = , J, resizeactive, 0 60 - bind = , K, resizeactive, 0 -60 - bind = , L, resizeactive, 60 0 - - bind = SHIFT, H, resizeactive, -20 0 - bind = SHIFT, J, resizeactive, 0 20 - bind = SHIFT, K, resizeactive, 0 -20 - bind = SHIFT, L, resizeactive, 20 0 - - bind = , return, submap, reset - bind = , escape, submap, reset - submap = reset - - # Window mode - bind = SUPER, G, submap, windows - submap = windows - bind = , Q, movetoworkspace, 1 - bind = , Q, submap, reset - - bind = , W, movetoworkspace, 2 - bind = , W, submap, reset - - bind = , E, movetoworkspace, 3 - bind = , E, submap, reset - - bind = , R, movetoworkspace, 4 - bind = , R, submap, reset - - # Special app toggle - bind = , B, exec, ${lib.getExe toggleFirefox} - - bind = , return, submap, reset - bind = , escape, submap, reset - submap = reset - ''; - }; + wayland.windowManager.hyprland.extraLuaFiles."keybinds" = '' + -- Common + hl.bind("SUPER", "RETURN", "exec, alacritty") + hl.bind("SUPER", "E", "exec, noctalia msg panel-toggle launcher") + hl.bind("SUPER", "P", "exec, noctalia msg panel-toggle session") + hl.bind("SUPER", "Q", "killactive") + hl.bind("ALT", "TAB", "exec, noctalia msg window-switcher") + hl.bind("ALT", "V", "exec, noctalia msg panel-toggle clipboard") + + -- Noctalia panels + hl.bind("SUPER", "N", "exec, noctalia msg panel-toggle control-center notifications") + hl.bind("MOD5", "C", "exec, noctalia msg panel-toggle control-center calendar") + hl.bind("MOD5", "S", "exec, noctalia msg panel-toggle control-center monitor") + hl.bind("MOD5", "V", "exec, noctalia msg panel-toggle clipboard") + + -- Window actions + hl.bind("SUPER", "F", "fullscreen, 1") + hl.bind("SUPER+SHIFT", "F", "fullscreen") + + -- Movement + hl.bind("SUPER", "H", "movefocus, l") + hl.bind("SUPER", "J", "movefocus, d") + hl.bind("SUPER", "K", "movefocus, u") + hl.bind("SUPER", "L", "movefocus, r") + + -- Window movement + hl.bind("SUPER+SHIFT", "H", "movewindow, l") + hl.bind("SUPER+SHIFT", "J", "movewindow, d") + hl.bind("SUPER+SHIFT", "K", "movewindow, u") + hl.bind("SUPER+SHIFT", "L", "movewindow, r") + + -- Layout toggle + hl.bind("SUPER", "T", "layoutmsg, togglesplit") + hl.bind("SUPER", "U", "togglefloating,") + + -- Workspace selection + hl.bind("SUPER", "1", "workspace, 1") + hl.bind("SUPER", "2", "workspace, 2") + hl.bind("SUPER", "3", "workspace, 3") + hl.bind("SUPER", "4", "workspace, 4") + hl.bind("SUPER", "5", "workspace, 5") + + -- Workspace handling scratchy + hl.bind("SUPER", "O", "togglespecialworkspace, scratchy") + hl.bind("SUPER", "M", "togglespecialworkspace, aux") + hl.bind("SUPER SHIFT", "O", "movetoworkspace, special:scratchy") + hl.bind("SUPER SHIFT", "M", "movetoworkspace, special:aux") + + -- Programs + hl.bind("SUPER", "Z", "exec, mumble rpc togglemute") + hl.bind("SUPER+SHIFT", "Z", "exec, mumble rpc toggledeaf") + hl.bind("SUPER", "period", 'exec, noctalia msg panel-toggle launcher "/emo "') + hl.bind("SUPER+SHIFT", "I", "exec, systemctl restart --user kanshi.service") + + -- Mouse binds + hl.bindm("SUPER", "mouse:272", "movewindow") + hl.bindm("SUPER", "mouse:273", "resizewindow") + + -- Resize mode + hl.define_submap("resize", function() + hl.bind("", "H", "resizeactive, -60 0") + hl.bind("", "J", "resizeactive, 0 60") + hl.bind("", "K", "resizeactive, 0 -60") + hl.bind("", "L", "resizeactive, 60 0") + + hl.bind("SHIFT", "H", "resizeactive, -20 0") + hl.bind("SHIFT", "J", "resizeactive, 0 20") + hl.bind("SHIFT", "K", "resizeactive, 0 -20") + hl.bind("SHIFT", "L", "resizeactive, 20 0") + + hl.bind("", "return", "submap, reset") + hl.bind("", "escape", "submap, reset") + end) + hl.bind("SUPER", "R", "submap, resize") + + -- Window mode + hl.define_submap("windows", function() + hl.bind("", "Q", "movetoworkspace, 1") + hl.bind("", "Q", "submap, reset") + + hl.bind("", "W", "movetoworkspace, 2") + hl.bind("", "W", "submap, reset") + + hl.bind("", "E", "movetoworkspace, 3") + hl.bind("", "E", "submap, reset") + + hl.bind("", "R", "movetoworkspace, 4") + hl.bind("", "R", "submap, reset") + + -- Special app toggle + hl.bind("", "B", "exec, ${lib.getExe toggleFirefox}") + + hl.bind("", "return", "submap, reset") + hl.bind("", "escape", "submap, reset") + end) + hl.bind("SUPER", "G", "submap, windows") + ''; }; } From d7b82a91880ff9a4d42b367ddf1997d96d020e2e Mon Sep 17 00:00:00 2001 From: RAPSNX Date: Mon, 31 Aug 2026 12:04:19 +0200 Subject: [PATCH 2/2] feat(hyprland): add noctalia mode submap, satty screenshot tool, and mode banners --- docs/reference/hyprland.md | 21 ++++++--- docs/reference/noctalia.md | 5 +-- modules/home/desktops/hyprland/keybinds.nix | 48 +++++++++++++++++---- modules/home/programs/default.nix | 3 ++ 4 files changed, 60 insertions(+), 17 deletions(-) diff --git a/docs/reference/hyprland.md b/docs/reference/hyprland.md index ca2eb9fc..568a9a89 100644 --- a/docs/reference/hyprland.md +++ b/docs/reference/hyprland.md @@ -15,12 +15,9 @@ General docs for hyprland. | `Super+E` | Launcher | | `Super+P` | Noctalia session panel | | `Super+Q` | Kill active | -| `Alt+V` / `AltGr+V` | Clipboard history | | `Alt+Shift` | Switch keyboard layout | | `Alt+Tab` | Window switcher | -| `Super+N` | Noctalia notification controls | -| `AltGr+C` | Noctalia calendar | -| `AltGr+S` | Noctalia system monitor | +| `Super+N` | Enter Noctalia mode | | `Super+.` | Noctalia emoji search | ## Window @@ -68,6 +65,20 @@ General docs for hyprland. | `Super+Shift+Z` | Mumble deaf | | `Super+.` | Noctalia emoji search | +## Noctalia Mode + +Enter: `Super+N` + +| Key | Action | +|---|---| +| `N` | Notifications / Control Center | +| `M` | System monitor | +| `C` | Calendar | +| `S` | Screenshot region (Noctalia) | +| `Shift+S` | Screenshot fullscreen (Noctalia) | +| `A` | Annotated screenshot (Satty) | +| `Enter` / `Esc` | Exit | + ## Resize Mode Enter: `Super+R` @@ -80,7 +91,7 @@ Enter: `Super+R` ## Window Mode -Enter: `Super+W` +Enter: `Super+G` | Key | Action | |---|---| diff --git a/docs/reference/noctalia.md b/docs/reference/noctalia.md index 4e9abc9a..8382bccf 100644 --- a/docs/reference/noctalia.md +++ b/docs/reference/noctalia.md @@ -47,9 +47,6 @@ Remove that marker only when the declarative migration should be run again. |---|---| | `Super+E` | Toggle launcher | | `Super+P` | Toggle session panel | -| `Super+N` | Open notification controls | -| `Alt+V` / `AltGr+V` | Toggle clipboard history | -| `AltGr+C` | Toggle calendar | -| `AltGr+S` | Toggle system monitor | +| `Super+N` | Enter Noctalia mode (`n` notifications, `m` monitor, `c` calendar, `s` region capture, `S` full capture, `a` annotate with satty) | | `Super+.` | Open emoji search | | `Alt+Tab` | Open window switcher | diff --git a/modules/home/desktops/hyprland/keybinds.nix b/modules/home/desktops/hyprland/keybinds.nix index e3567cf5..4b2502b6 100644 --- a/modules/home/desktops/hyprland/keybinds.nix +++ b/modules/home/desktops/hyprland/keybinds.nix @@ -37,13 +37,6 @@ in hl.bind("SUPER", "P", "exec, noctalia msg panel-toggle session") hl.bind("SUPER", "Q", "killactive") hl.bind("ALT", "TAB", "exec, noctalia msg window-switcher") - hl.bind("ALT", "V", "exec, noctalia msg panel-toggle clipboard") - - -- Noctalia panels - hl.bind("SUPER", "N", "exec, noctalia msg panel-toggle control-center notifications") - hl.bind("MOD5", "C", "exec, noctalia msg panel-toggle control-center calendar") - hl.bind("MOD5", "S", "exec, noctalia msg panel-toggle control-center monitor") - hl.bind("MOD5", "V", "exec, noctalia msg panel-toggle clipboard") -- Window actions hl.bind("SUPER", "F", "fullscreen, 1") @@ -88,6 +81,34 @@ in hl.bindm("SUPER", "mouse:272", "movewindow") hl.bindm("SUPER", "mouse:273", "resizewindow") + -- Noctalia Mode + hl.define_submap("noctalia", function() + hl.bind("", "n", "exec, noctalia msg panel-toggle control-center notifications; noctalia msg notification-clear-active") + hl.bind("", "n", "submap, reset") + + hl.bind("", "m", "exec, noctalia msg panel-toggle control-center monitor; noctalia msg notification-clear-active") + hl.bind("", "m", "submap, reset") + + hl.bind("", "c", "exec, noctalia msg panel-toggle control-center calendar; noctalia msg notification-clear-active") + hl.bind("", "c", "submap, reset") + + hl.bind("", "s", "exec, noctalia msg screenshot-region; noctalia msg notification-clear-active") + hl.bind("", "s", "submap, reset") + + hl.bind("SHIFT", "S", "exec, noctalia msg screenshot-fullscreen; noctalia msg notification-clear-active") + hl.bind("SHIFT", "S", "submap, reset") + + hl.bind("", "a", 'exec, ${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp})" - | ${lib.getExe pkgs.satty} --filename -; noctalia msg notification-clear-active') + hl.bind("", "a", "submap, reset") + + hl.bind("", "return", "exec, noctalia msg notification-clear-active") + hl.bind("", "return", "submap, reset") + hl.bind("", "escape", "exec, noctalia msg notification-clear-active") + hl.bind("", "escape", "submap, reset") + end) + hl.bind("SUPER", "N", "exec, noctalia msg notification-show 'MODE: NOCTALIA' '[n] Notifications [m] Monitor [c] Calendar [s] Region [S] Full [a] Annotate'") + hl.bind("SUPER", "N", "submap, noctalia") + -- Resize mode hl.define_submap("resize", function() hl.bind("", "H", "resizeactive, -60 0") @@ -100,31 +121,42 @@ in hl.bind("SHIFT", "K", "resizeactive, 0 -20") hl.bind("SHIFT", "L", "resizeactive, 20 0") + hl.bind("", "return", "exec, noctalia msg notification-clear-active") hl.bind("", "return", "submap, reset") + hl.bind("", "escape", "exec, noctalia msg notification-clear-active") hl.bind("", "escape", "submap, reset") end) + hl.bind("SUPER", "R", "exec, noctalia msg notification-show 'MODE: RESIZE' '[H/J/K/L] Resize [Shift+H/J/K/L] Fine [Esc/Enter] Exit'") hl.bind("SUPER", "R", "submap, resize") -- Window mode hl.define_submap("windows", function() hl.bind("", "Q", "movetoworkspace, 1") + hl.bind("", "Q", "exec, noctalia msg notification-clear-active") hl.bind("", "Q", "submap, reset") hl.bind("", "W", "movetoworkspace, 2") + hl.bind("", "W", "exec, noctalia msg notification-clear-active") hl.bind("", "W", "submap, reset") hl.bind("", "E", "movetoworkspace, 3") + hl.bind("", "E", "exec, noctalia msg notification-clear-active") hl.bind("", "E", "submap, reset") hl.bind("", "R", "movetoworkspace, 4") + hl.bind("", "R", "exec, noctalia msg notification-clear-active") hl.bind("", "R", "submap, reset") -- Special app toggle - hl.bind("", "B", "exec, ${lib.getExe toggleFirefox}") + hl.bind("", "B", "exec, ${lib.getExe toggleFirefox}; noctalia msg notification-clear-active") + hl.bind("", "B", "submap, reset") + hl.bind("", "return", "exec, noctalia msg notification-clear-active") hl.bind("", "return", "submap, reset") + hl.bind("", "escape", "exec, noctalia msg notification-clear-active") hl.bind("", "escape", "submap, reset") end) + hl.bind("SUPER", "G", "exec, noctalia msg notification-show 'MODE: WINDOWS' '[Q/W/E/R] Move to WS [B] Toggle Firefox [Esc/Enter] Exit'") hl.bind("SUPER", "G", "submap, windows") ''; }; diff --git a/modules/home/programs/default.nix b/modules/home/programs/default.nix index 48ca0d73..4701bb69 100644 --- a/modules/home/programs/default.nix +++ b/modules/home/programs/default.nix @@ -9,6 +9,9 @@ # Screenshot / Recording wf-recorder noisetorch + satty + grim + slurp # Tools nwg-displays