hyprland: cleanup

This commit is contained in:
Charlie Root 2024-08-28 14:17:38 +02:00
commit 40edb95bb1
5 changed files with 42 additions and 78 deletions

View file

@ -24,14 +24,12 @@
ffmpeg-full ffmpeg-full
fftw fftw
fzf fzf
#gadacz
gcc gcc
gdb gdb
gnumake gnumake
grc grc
git git
helvum helvum
hmm
httpie httpie
hyperfine hyperfine
imagemagick imagemagick
@ -45,7 +43,6 @@
libtool libtool
links2 links2
mapscii mapscii
mars-mips
moc moc
ncmpcpp ncmpcpp
neofetch neofetch
@ -79,7 +76,6 @@
trash-cli trash-cli
tree tree
ttyper ttyper
typst
unzip unzip
util-linux util-linux
v4l-utils v4l-utils

View file

@ -1,6 +1,6 @@
_: { _: {
imports = [ imports = [
./hypr ./hyprland/module.nix
./variables.nix ./variables.nix
]; ];
} }

View file

@ -1,6 +1,7 @@
{ {
config, config,
pkgs, pkgs,
...
}: let }: let
cfg = config.modules.usrEnv.desktops.hyprland; cfg = config.modules.usrEnv.desktops.hyprland;
inherit (config.modules.other.system) username; inherit (config.modules.other.system) username;

View file

@ -9,49 +9,47 @@
inherit (builtins) map genList attrNames toString; inherit (builtins) map genList attrNames toString;
in { in {
home-manager.users.${username} = { home-manager.users.${username} = {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland.settings = {
settings = { # Monitor config
# Monitor config # monitor = [
# monitor = [ # "eDP-1,1920x1080,0x0,1"
# "eDP-1,1920x1080,0x0,1" # # "DP-2,1920x1080,0x0,1"
# # "DP-2,1920x1080,0x0,1" # # "HDMI-A-2,1920x1080,1920x0,1"
# # "HDMI-A-2,1920x1080,1920x0,1" # # "HDMI-A-1,1920x1080,3840x0,1"
# # "HDMI-A-1,1920x1080,3840x0,1" # # Had the shadow monitor bug, so had to disable all unknown monitors.
# # Had the shadow monitor bug, so had to disable all unknown monitors. # "Unknown-1,disable"
# "Unknown-1,disable" # ];
# ];
# INFO: This is a custom function to map all of my monitors to workspaces. # 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 # Since I use split-monitor-workspaces, I map 10 workspaces to each monitor
# and set the first one to be the default one. # 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: # To be able to use this for a varying amount of monitors we do some nasty trickery:
workspace = workspace =
# We're creating several lists of workspace assignments, one for each monitor, # We're creating several lists of workspace assignments, one for each monitor,
# and have to merge them into one big list. # and have to merge them into one big list.
(flatten (flatten
# We then use imap0 insted of map because imap0 starts indexing at zero as oppsed to one with map. # We then use imap0 insted of map because imap0 starts indexing at zero as oppsed to one with map.
(imap0 (monitorIndex: monitorName: ( (imap0 (monitorIndex: monitorName: (
map ( map (
i: let i: let
# we define our own modulo operation for this, # we define our own modulo operation for this,
# since only the first workspace on each monitor is the default workspace. # since only the first workspace on each monitor is the default workspace.
mod = a: b: a - (b * (a / b)); mod = a: b: a - (b * (a / b));
workspace = toString i; workspace = toString i;
isDefault = (mod i 10) == 1; # 11, 21, 31, ... isDefault = (mod i 10) == 1; # 11, 21, 31, ...
in "${workspace}, monitor:${monitorName}${optionalString isDefault ", default:true"}" 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. # 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. # also, we add the monitorIndex * 10 to get 10 workspaces for each individual monitor.
(genList (i: i + 1 + (10 * monitorIndex)) 10) (genList (i: i + 1 + (10 * monitorIndex)) 10)
)) ))
# our attrSet of different monitors # our attrSet of different monitors
(attrNames monitors))) (attrNames monitors)))
# These are my two special workspaces # These are my two special workspaces
++ [ ++ [
"special:nixos, decorate:false" "special:nixos, decorate:false"
"special:keepassxc, decorate:false" "special:keepassxc, decorate:false"
]; ];
};
}; };
}; };
} }

View file

@ -1,31 +0,0 @@
{
inputs',
config,
...
}: {
programs.niri = {
enable = true;
package = inputs'.niri.packages.niri-unstable;
};
services = {
greetd = {
enable = true;
settings = rec {
initial_session = {
command = "${config.programs.niri.package}/bin/niri-session";
user = "vali";
};
default_session = initial_session;
};
};
gnome = {
# glib-networking.enable = true;
};
# lorri.enable = true;
# udisks2.enable = true;
# printing.enable = true;
# fstrim.enable = true;
};
}