temporarily return home-manger, working hyprland module
This commit is contained in:
parent
eead8facb0
commit
fbb93a59d4
10 changed files with 406 additions and 200 deletions
|
@ -3,45 +3,42 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.meta.mainUser) username;
|
||||
inherit (config.modules.system.hardware) monitors;
|
||||
inherit (lib) imap0 flatten optionalString;
|
||||
inherit (builtins) map genList attrNames toString;
|
||||
in {
|
||||
home-manager.users.${username} = {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
# INFO: This is a custom function to map all of my monitors to workspaces.
|
||||
# Since I use split-monitor-workspaces, I map 10 workspaces to each monitor
|
||||
# and set the first one to be the default one.
|
||||
# To be able to use this for a varying amount of monitors we do some nasty trickery.
|
||||
# This was inspired by jacekpoz, whose configuration is linked in this project's README.md.
|
||||
workspace =
|
||||
# We're creating several lists of workspace assignments, one for each monitor,
|
||||
# and have to merge them into one big list.
|
||||
(flatten
|
||||
# We then use imap0 insted of map because imap0 starts indexing at zero as oppsed to one with map.
|
||||
(imap0 (monitorIndex: monitorName: (
|
||||
map (
|
||||
i: let
|
||||
# we define our own modulo operation for this,
|
||||
# since only the first workspace on each monitor is the default workspace.
|
||||
mod = a: b: a - (b * (a / b));
|
||||
workspace = toString i;
|
||||
isDefault = (mod i 10) == 1; # 11, 21, 31, ...
|
||||
in "${workspace}, monitor:${monitorName}${optionalString isDefault ", default:true"}"
|
||||
)
|
||||
# we generate a list of 10 elements for each monitor. We have to add 1 each time since genList starts indexing at 0.
|
||||
# also, we add the monitorIndex * 10 to get 10 workspaces for each individual monitor.
|
||||
(genList (i: i + 1 + (10 * monitorIndex)) 10)
|
||||
))
|
||||
# our attrSet of different monitors
|
||||
(attrNames monitors)))
|
||||
# These are my two special workspaces
|
||||
++ [
|
||||
"special:nixos, decorate:false"
|
||||
"special:keepassxc, decorate:false"
|
||||
"special:audio, decorate:false"
|
||||
];
|
||||
};
|
||||
programs.hyprland.settings = {
|
||||
# INFO: This is a custom function to map all of my monitors to workspaces.
|
||||
# Since I use split-monitor-workspaces, I map 10 workspaces to each monitor
|
||||
# and set the first one to be the default one.
|
||||
# To be able to use this for a varying amount of monitors we do some nasty trickery.
|
||||
# This was inspired by jacekpoz, whose configuration is linked in this project's README.md.
|
||||
workspace =
|
||||
# We're creating several lists of workspace assignments, one for each monitor,
|
||||
# and have to merge them into one big list.
|
||||
(flatten
|
||||
# We then use imap0 insted of map because imap0 starts indexing at zero as oppsed to one with map.
|
||||
(imap0 (monitorIndex: monitorName: (
|
||||
map (
|
||||
i: let
|
||||
# we define our own modulo operation for this,
|
||||
# since only the first workspace on each monitor is the default workspace.
|
||||
mod = a: b: a - (b * (a / b));
|
||||
workspace = toString i;
|
||||
isDefault = (mod i 10) == 1; # 11, 21, 31, ...
|
||||
in "${workspace}, monitor:${monitorName}${optionalString isDefault ", default:true"}"
|
||||
)
|
||||
# we generate a list of 10 elements for each monitor. We have to add 1 each time since genList starts indexing at 0.
|
||||
# also, we add the monitorIndex * 10 to get 10 workspaces for each individual monitor.
|
||||
(genList (i: i + 1 + (10 * monitorIndex)) 10)
|
||||
))
|
||||
# our attrSet of different monitors
|
||||
(attrNames monitors)))
|
||||
# These are my two special workspaces
|
||||
++ [
|
||||
"special:nixos, decorate:false"
|
||||
"special:keepassxc, decorate:false"
|
||||
"special:audio, decorate:false"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue