refactor(desktop): extend hyprland module with workspaces

This commit is contained in:
tux
2026-09-20 02:00:10 +05:30
parent c91fbb02fc
commit 790eb24be3
4 changed files with 30 additions and 3 deletions

6
flake.lock generated
View File

@@ -2489,11 +2489,11 @@
},
"twm": {
"locked": {
"lastModified": 1789847958,
"narHash": "sha256-0XZpBvmt677u2zqy53OI2gBtkJCOtH2lxUAgv3Lvnxc=",
"lastModified": 1789849521,
"narHash": "sha256-FYFqM30bMqGgXHgAMb2K85mhV0kdVuevLGZlViALDCU=",
"owner": "tuxdotrs",
"repo": "twm",
"rev": "e3352d44ce24e3319901c4eb30a0758cb0fb6171",
"rev": "4b8cf8739b5051b9eab56ee7505dbbd5308868ba",
"type": "github"
},
"original": {

View File

@@ -16,6 +16,12 @@
default = "";
description = "Hyprland monitor configuration";
};
workspaceConfig = mkOption {
type = types.lines;
default = "";
description = "Hyprland workspace configuration";
};
};
config = mkIf cfg.enable {
@@ -34,6 +40,7 @@
source = pkgs.twm.hyprland;
};
".config/hypr/config/monitors.lua".text = cfg.monitorConfig;
".config/hypr/config/workspaces.lua".text = cfg.workspaceConfig;
};
home.packages = with pkgs; [

View File

@@ -16,6 +16,16 @@
scale = "1",
})
'';
workspaceConfig = ''
hl.workspace_rule({ workspace = "1", monitor = "eDP-1", default = true })
hl.workspace_rule({ workspace = "2", monitor = "eDP-1" })
hl.workspace_rule({ workspace = "3", monitor = "eDP-1" })
hl.workspace_rule({ workspace = "4", monitor = "eDP-1" })
hl.workspace_rule({ workspace = "5", monitor = "eDP-1" })
hl.workspace_rule({ workspace = "6", monitor = "eDP-1", layout = "scrolling" })
hl.workspace_rule({ workspace = "7", monitor = "eDP-1", layout = "scrolling" })
'';
};
mangowm = {

View File

@@ -32,6 +32,16 @@
transform = 3,
})
'';
workspaceConfig = ''
hl.workspace_rule({ workspace = "1", monitor = "DP-3", default = true })
hl.workspace_rule({ workspace = "2", monitor = "DP-3" })
hl.workspace_rule({ workspace = "3", monitor = "DP-3" })
hl.workspace_rule({ workspace = "4", monitor = "DP-3" })
hl.workspace_rule({ workspace = "5", monitor = "DP-3" })
hl.workspace_rule({ workspace = "6", monitor = "DP-2", layout = "scrolling", layout_opts = { direction = "down" } })
hl.workspace_rule({ workspace = "7", monitor = "DP-1", layout = "scrolling", layout_opts = { direction = "down" } })
'';
};
mangowm = {