hyprland: make workspaces host-defined
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m24s

This commit is contained in:
2026-01-30 17:32:10 +01:00
parent 85ecdc8c72
commit d3f856d112
4 changed files with 51 additions and 55 deletions

View File

@@ -59,7 +59,19 @@
hyprland.enableGrimblast = true;
hyprland.enableWacom = true;
hyprland.cursorNoHardware = true;
hyprland.workspaceStrategy = "named";
hyprland.extraWorkspaces = [
"name:T1, monitor:$mon_top, persistent:true, default:true"
"name:T2, monitor:$mon_top, persistent:true, default:false"
"name:L1, monitor:$mon_left, persistent:true, default:true"
"name:L2, monitor:$mon_left, persistent:true, default:false"
"name:R1, monitor:$mon_right, persistent:true, default:true"
"name:R2, monitor:$mon_right, persistent:true, default:false"
"name:c1, monitor:$mon_center, persistent:true, default:true"
"name:c2, monitor:$mon_center, persistent:true, default:false"
"name:c3, monitor:$mon_center, persistent:true, default:false"
"name:c4, monitor:$mon_center, persistent:true, default:false"
];
hyprland.monitorVariables = {
"$mon_top" = "desc:BNQ G2420HDBL T2B04424SL000";
@@ -80,6 +92,19 @@
"$shiftMainMod,Print,exec,grimblast copy area"
",Print,exec,grimblast copy active"
"$mainMod,v,exec,sleep 0.5s && wl-paste | wtype -"
# Workspace keybinds
"$mainMod,1,workspace,name:c1"
"$mainMod,2,workspace,name:c2"
"$mainMod,3,workspace,name:c3"
"$mainMod,4,workspace,name:c4"
"$mainMod,5,workspace,5"
"$mainMod,6,workspace,6"
"$shiftMainMod,1,movetoworkspace,name:c1"
"$shiftMainMod,2,movetoworkspace,name:c2"
"$shiftMainMod,3,movetoworkspace,name:c3"
"$shiftMainMod,4,movetoworkspace,name:c4"
"$shiftMainMod,5,movetoworkspace,5"
"$shiftMainMod,6,movetoworkspace,6"
];
home = {
username = "${user}";

View File

@@ -38,6 +38,21 @@
tmux.enable = true;
hyprland.enable = true;
hyprland.monitors = [ "eDP-1,1920x1080@60,0x0,1" ];
hyprland.extraKeybinds = [
# Workspace keybinds
"$mainMod,1,workspace,1"
"$mainMod,2,workspace,2"
"$mainMod,3,workspace,3"
"$mainMod,4,workspace,4"
"$mainMod,5,workspace,5"
"$mainMod,6,workspace,6"
"$shiftMainMod,1,movetoworkspace,1"
"$shiftMainMod,2,movetoworkspace,2"
"$shiftMainMod,3,movetoworkspace,3"
"$shiftMainMod,4,movetoworkspace,4"
"$shiftMainMod,5,movetoworkspace,5"
"$shiftMainMod,6,movetoworkspace,6"
];
home = {
username = "${user}";
homeDirectory = "/home/${user}";

View File

@@ -56,13 +56,14 @@ in
description = "Monitor names for hyprlock backgrounds (null for all monitors)";
};
workspaceStrategy = mkOption {
type = types.enum [
"numbered"
"named"
extraWorkspaces = mkOption {
type = types.listOf types.str;
default = [ ];
example = [
"1, monitor:eDP-1, persistent:true, default:true"
"2, monitor:eDP-1, persistent:true"
];
default = "numbered";
description = "Workspace naming strategy: numbered (1-6) or named per monitor";
description = "Extra workspace definitions for Hyprland";
};
monitorVariables = mkOption {
@@ -281,22 +282,8 @@ in
];
workspace =
if cfg.workspaceStrategy == "named" then
[
"name:T1, monitor:$mon_top, persistent:true, default:true"
"name:T2, monitor:$mon_top, persistent:true, default:false"
"name:L1, monitor:$mon_left, persistent:true, default:true"
"name:L2, monitor:$mon_left, persistent:true, default:false"
"name:R1, monitor:$mon_right, persistent:true, default:true"
"name:R2, monitor:$mon_right, persistent:true, default:false"
"name:c1, monitor:$mon_center, persistent:true, default:true"
"name:c2, monitor:$mon_center, persistent:true, default:false"
"name:c3, monitor:$mon_center, persistent:true, default:false"
"name:c4, monitor:$mon_center, persistent:true, default:false"
"special:special, on-created-empty:kitty, rounding:true, decorate:false, border:false"
]
else
[ "special:special, on-created-empty:kitty, rounding:true, decorate:false, border:false" ];
[ "special:special, on-created-empty:kitty, rounding:true, decorate:false, border:false" ]
++ cfg.extraWorkspaces;
bindm = [
"$mainMod,mouse:272,movewindow"
@@ -335,38 +322,6 @@ in
"$shiftMainMod,o,exec, hl-no-opacity"
]
++ cfg.extraKeybinds
++ (
if cfg.workspaceStrategy == "numbered" then
[
"$mainMod,1,workspace,1"
"$mainMod,2,workspace,2"
"$mainMod,3,workspace,3"
"$mainMod,4,workspace,4"
"$mainMod,5,workspace,5"
"$mainMod,6,workspace,6"
"$shiftMainMod,1,movetoworkspace,1"
"$shiftMainMod,2,movetoworkspace,2"
"$shiftMainMod,3,movetoworkspace,3"
"$shiftMainMod,4,movetoworkspace,4"
"$shiftMainMod,5,movetoworkspace,5"
"$shiftMainMod,5,movetoworkspace,6"
]
else
[
"$mainMod,1,workspace,name:c1"
"$mainMod,2,workspace,name:c2"
"$mainMod,3,workspace,name:c3"
"$mainMod,4,workspace,name:c4"
"$mainMod,5,workspace,5"
"$mainMod,6,workspace,6"
"$shiftMainMod,1,movetoworkspace,name:c1"
"$shiftMainMod,2,movetoworkspace,name:c2"
"$shiftMainMod,3,movetoworkspace,name:c3"
"$shiftMainMod,4,movetoworkspace,name:c4"
"$shiftMainMod,5,movetoworkspace,5"
"$shiftMainMod,6,movetoworkspace,6"
]
)
++ [
# Special workspace
"$mainMod,c,togglespecialworkspace"

View File

@@ -13,6 +13,7 @@ in
bat
bzip2
chromium
claude-code
croc
devenv
distrobox