Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/reference/hyprland.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
137 changes: 67 additions & 70 deletions modules/home/desktops/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ in

wayland.windowManager.hyprland = {
enable = true;
configType = "hyprlang";
configType = "lua";

inherit (cfg) package;

Expand All @@ -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}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Escape autostart commands before embedding them in Lua

When a roles.desktop.hyprland.autostart entry contains quotes, backslashes, or a newline—for example, a command with a quoted shell argument—this interpolation inserts those characters directly into the Lua string, potentially changing the command or making the generated configuration invalid. The option accepts arbitrary strings and the previous Home Manager settings serializer escaped them, so serialize each command as a valid Lua-compatible quoted string instead of wrapping ${cmd} manually.

Useful? React with 👍 / 👎.

'';
};
};
}
Expand Down
200 changes: 97 additions & 103 deletions modules/home/desktops/hyprland/keybinds.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove MOD5 shortcuts that steal German characters

When the configured EurKEY or German layouts are active, MOD5 is AltGr, so these global bindings intercept character-entry combinations—most notably AltGr+S, which should type ß, but now opens the system monitor instead. This directly reintroduces the keyboard conflict documented in NOCTALIA_MODE_PLAN.md:3-8 and affects the layouts configured in default.nix:83-85; move these actions behind a non-AltGr shortcut or submap.

Useful? React with 👍 / 👎.


-- 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")
'';
};
}