feat: bind workspace to monitors
This commit is contained in:
parent
71093e1c0f
commit
8c498d10ec
3 changed files with 20 additions and 0 deletions
13
home/user/hypr/workspace.nix
Normal file
13
home/user/hypr/workspace.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{ monitors }:
|
||||||
|
let
|
||||||
|
monitorNum = builtins.length monitors;
|
||||||
|
workspaceNum = 10;
|
||||||
|
workspaceList = builtins.genList (
|
||||||
|
index:
|
||||||
|
let
|
||||||
|
currentNum = index - (monitorNum * (index / monitorNum));
|
||||||
|
in
|
||||||
|
"${builtins.toString (index + 1)}, monitor:${builtins.elemAt monitors currentNum}"
|
||||||
|
) workspaceNum;
|
||||||
|
in
|
||||||
|
if (monitorNum > 0) then workspaceList else [ ]
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
hyprcursor-size,
|
hyprcursor-size,
|
||||||
xcursor-size,
|
xcursor-size,
|
||||||
nvidia-offload-enabled ? false,
|
nvidia-offload-enabled ? false,
|
||||||
|
monitors ? [ ],
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -91,6 +92,7 @@ in
|
||||||
''XDG_SESSION_DESKTOP, Hyprland''
|
''XDG_SESSION_DESKTOP, Hyprland''
|
||||||
''GDK_PIXBUF_MODULE_FILE, ${pkgs.librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache'' # Make rofi load svg
|
''GDK_PIXBUF_MODULE_FILE, ${pkgs.librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache'' # Make rofi load svg
|
||||||
];
|
];
|
||||||
|
workspace = import ./hypr/workspace.nix { inherit monitors; };
|
||||||
}
|
}
|
||||||
// window
|
// window
|
||||||
// windowrule
|
// windowrule
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,10 @@ let
|
||||||
nvidia-bus-id = "PCI:1:0:0";
|
nvidia-bus-id = "PCI:1:0:0";
|
||||||
nvidia-offload-enabled = config.hardware.nvidia.prime.offload.enable;
|
nvidia-offload-enabled = config.hardware.nvidia.prime.offload.enable;
|
||||||
device-name = "dn-pre7780";
|
device-name = "dn-pre7780";
|
||||||
|
monitors = [
|
||||||
|
"DP-3"
|
||||||
|
"HDMI-A-2"
|
||||||
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -61,6 +65,7 @@ in
|
||||||
username
|
username
|
||||||
nvidia-offload-enabled
|
nvidia-offload-enabled
|
||||||
device-name
|
device-name
|
||||||
|
monitors
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
users."${username}" = {
|
users."${username}" = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue