1
1
Fork 0

custom: add top-level desktop option

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-12-30 10:09:03 -06:00
parent 0ec4890572
commit d9bade7500
Signed by: Myned
GPG key ID: C7224454F7881A34
3 changed files with 15 additions and 16 deletions

View file

@ -36,6 +36,13 @@ in {
rounding = mkOption {default = 15;}; rounding = mkOption {default = 15;};
### Misc ### Misc
desktop = mkOption {
default =
if config.custom.full
then "niri"
else "gnome";
};
lockscreen = mkOption {default = "hyprlock";}; lockscreen = mkOption {default = "hyprlock";};
wallpaper = mkOption {default = false;}; wallpaper = mkOption {default = false;};

View file

@ -8,22 +8,15 @@ with lib; let
in { in {
options.custom.desktops = { options.custom.desktops = {
enable = mkOption {default = config.custom.minimal;}; enable = mkOption {default = config.custom.minimal;};
desktop = mkOption {
default =
if config.custom.full
then "niri"
else "gnome";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
custom.desktops = { custom.desktops = {
gnome.enable = cfg.desktop == "gnome"; gnome.enable = config.custom.desktop == "gnome";
hyprland.enable = cfg.desktop == "hyprland"; hyprland.enable = config.custom.desktop == "hyprland";
kde.enable = cfg.desktop == "kde"; kde.enable = config.custom.desktop == "kde";
niri.enable = cfg.desktop == "niri"; niri.enable = config.custom.desktop == "niri";
sway.enable = cfg.desktop == "sway"; sway.enable = config.custom.desktop == "sway";
}; };
}; };
} }

View file

@ -40,7 +40,6 @@ with lib; let
in { in {
options.custom.programs.waybar = { options.custom.programs.waybar = {
enable = mkOption {default = false;}; enable = mkOption {default = false;};
desktop = mkOption {default = config.custom.desktops.desktop;};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -98,12 +97,12 @@ in {
smooth-scrolling-threshold = 2; smooth-scrolling-threshold = 2;
on-scroll-down = on-scroll-down =
if cfg.desktop == "niri" if config.custom.desktop == "niri"
then "${niri} msg action focus-workspace-down" then "${niri} msg action focus-workspace-down"
else ""; else "";
on-scroll-up = on-scroll-up =
if cfg.desktop == "niri" if config.custom.desktop == "niri"
then "${niri} msg action focus-workspace-up" then "${niri} msg action focus-workspace-up"
else ""; else "";
}; };
@ -302,7 +301,7 @@ in {
#// on-click = ""; #// on-click = "";
on-click-middle = on-click-middle =
if cfg.desktop == "niri" if config.custom.desktop == "niri"
then ''${niri} msg action close-window --id "$(${niri} msg -j windows | ${jq} '.[] | select(.app_id == "YouTube Music").id')"'' then ''${niri} msg action close-window --id "$(${niri} msg -j windows | ${jq} '.[] | select(.app_id == "YouTube Music").id')"''
else ""; else "";