tons of theme tweaks, +gruvbox

This commit is contained in:
Reid 2026-04-22 21:32:27 -07:00
parent 80d22a470a
commit 2ad77494b2
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
30 changed files with 410 additions and 371 deletions

View file

@ -12,35 +12,38 @@ in {
description = "Name of the theme to apply; see modules/desktop/themes for a list of valid options";
};
rounding = mkOpt int 10;
padding = mkOpt int 6;
dark = mkOpt bool false;
gtkTheme = {
name = mkOpt str "";
package = mkPackageOption pkgs "gtk" {};
name = mkOpt (nullOr str) null;
package = mkOpt (nullOr package) null;
};
kvantumTheme = {
name = mkOpt str "";
package = mkPackageOption pkgs "kvantum" {};
name = mkOpt (nullOr str) null;
package = mkOpt (nullOr package) null;
};
iconTheme = {
name = mkOpt str "";
package = mkPackageOption pkgs "icon" {};
name = mkOpt (nullOr str) null;
package = mkOpt (nullOr package) null;
};
cursorTheme = {
name = mkOpt str "";
package = mkPackageOption pkgs "cursor" {};
name = mkOpt (nullOr str) null;
package = mkOpt (nullOr package) null;
size = mkOpt int 24;
};
editor = {
vscode = {
colorTheme = {
name = mkOpt str "";
extension = mkPackageOption pkgs "extension" {};
name = mkOpt (nullOr str) null;
extension = mkOpt (nullOr package) null;
};
iconTheme = {
name = mkOpt str "";
extension = mkPackageOption pkgs "extension" {};
name = mkOpt (nullOr str) null;
extension = mkOpt (nullOr package) null;
};
};
};
@ -52,7 +55,7 @@ in {
background = mkOpt str "";
};
waybar = mkOpt str "";
waybarTop = mkOpt str "";
wob = {
borderColor = mkOpt (nullOr str) null;
@ -60,9 +63,7 @@ in {
barColor = mkOpt (nullOr str) null;
};
rofi = mkOpt (nullOr str) null;
fuzzel = mkOpt (nullOr str) null;
rofiTop = mkOpt (nullOr str) null;
wezterm = mkOpt (nullOr str) null;
@ -102,8 +103,8 @@ in {
hm.qt = {
enable = true;
platformTheme.name = "qtct";
style.name = "kvantum";
platformTheme.name = if (cfg.kvantumTheme.name != null) then "qtct" else "gtk3";
style.name = mkIf (cfg.kvantumTheme.name != null) "kvantum";
};
hm.home.pointerCursor = {
@ -136,7 +137,16 @@ in {
};
};
hm.programs.waybar.style = cfg.waybar;
hm.programs.waybar.style = (builtins.replaceStrings
[ "@rounding" ]
[ (builtins.toString cfg.rounding) ]
(builtins.concatStringsSep "\n" ([
cfg.waybarTop
(lib.readFile ./config/waybar.css)
]
++ lib.zipListsWith (name: hex: "@define-color base${name} #${hex};")
(builtins.genList (i: lib.fixedWidthString 2 "0" (lib.toUpper (lib.toHexString i))) 24)
config.scheme.toList)));
hm.services.wob.settings."" = {
border_color = cfg.wob.borderColor;
@ -144,18 +154,16 @@ in {
bar_color = cfg.wob.barColor;
};
# silly litle hack--rofi hm module doesn't play nice with strings
# so, we have to write the config to a file and then read it :P
# ...and then back to a string
hm.programs.rofi.theme = "${pkgs.writeTextFile {
name = "rofi-theme.rasi";
text = cfg.rofi;
}}";
hm.programs.fuzzel.settings.main = {
include = cfg.fuzzel;
icon-theme = cfg.iconTheme.name;
};
hm.programs.rofi.theme = builtins.toFile "rofi.rasi" (builtins.replaceStrings
[ "@rounding" ]
[ (builtins.toString cfg.rounding) ]
(builtins.concatStringsSep "\n" ([
cfg.rofiTop
(lib.readFile ./config/rofi.rasi)
]
++ lib.zipListsWith (name: hex: "* { base${name}: #${hex}; }")
(builtins.genList (i: lib.fixedWidthString 2 "0" (lib.toUpper (lib.toHexString i))) 24)
config.scheme.toList)));
hm.services.vicinae.settings.theme = let
themeConf = {
@ -179,7 +187,7 @@ in {
Appearance = {
icon_theme = cfg.iconTheme.name;
standard_dialogs = "xdgdesktopportal";
style = "kvantum";
style = "kvantum"; # its ok if this is always the case, override it anyway
};
Fonts = with config.modules.desktop.fonts.fonts; {
@ -187,22 +195,25 @@ in {
fixed = ''"${monospace.family},-1,${toString monospace.size},5,${toString weight},${zeros},1"'';
};
};
in {
# technically could cause issues with KDE if we use that
# not a concern for now
"kdeglobals".text = ''
[Icons]
Theme=${cfg.iconTheme.name}
'';
in mkMerge [
{
# technically could cause issues with KDE if we use that
# not a concern for now
"kdeglobals".text = ''
[Icons]
Theme=${cfg.iconTheme.name}
'';
"Kvantum/${cfg.kvantumTheme.name}".source = "${cfg.kvantumTheme.package}/share/Kvantum/${cfg.kvantumTheme.name}";
"Kvantum/kvantum.kvconfig".text = ''
[General]
theme=${cfg.kvantumTheme.name}
'';
"qt5ct/qt5ct.conf".source = iniFmt.generate "qt5ct.conf" (mkQtctConf 5);
"qt6ct/qt6ct.conf".source = iniFmt.generate "qt6ct.conf" (mkQtctConf 6);
};
"qt5ct/qt5ct.conf".source = iniFmt.generate "qt5ct.conf" (mkQtctConf 5);
"qt6ct/qt6ct.conf".source = iniFmt.generate "qt6ct.conf" (mkQtctConf 6);
}
(mkIf (cfg.kvantumTheme.name != null) {
"Kvantum/${cfg.kvantumTheme.name}".source = "${cfg.kvantumTheme.package}/share/Kvantum/${cfg.kvantumTheme.name}";
"Kvantum/kvantum.kvconfig".text = ''
[General]
theme=${cfg.kvantumTheme.name}
'';
})
];
};
}