home/theme: remove abstractions and simplify options

* removed gtk and icon theme option abstractions

* home/theme: remove cursorTheme options

* rustboro/home: migrate cursor theme overrides

* home/theme: use config.gtk.font instead of options.nix abstractions

* home/them: dark mode/light mode check for icons

* home/theme: remove terminalFont options

* home: move home.themes.colors.darkMode to home.themes.darkMode

* home/them: improve gnome font settings

* waybar: stay dark even when in light mode
This commit is contained in:
Aly Raffauf 2024-07-03 10:35:39 -04:00 committed by GitHub
parent 94b2c9f349
commit 76e6626187
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 124 additions and 194 deletions

View file

@ -18,10 +18,10 @@
}; };
font = { font = {
normal = { normal = {
family = "${config.ar.home.theme.terminalFont.name}"; family = "NotoSansM Nerd Font";
style = "Regular"; style = "Regular";
}; };
size = config.ar.home.theme.terminalFont.size; size = config.gtk.font.size;
}; };
selection.save_to_clipboard = true; selection.save_to_clipboard = true;
window = { window = {

View file

@ -14,8 +14,8 @@
}; };
main = { main = {
font = "${config.ar.home.theme.terminalFont.name}:size=${toString config.ar.home.theme.terminalFont.size}"; font = "NotoSansM Nerd Font:size=${toString config.gtk.font.size}";
icon-theme = "${config.ar.home.theme.iconTheme.name}"; icon-theme = "${config.gtk.iconTheme.name}";
layer = "overlay"; layer = "overlay";
lines = 3; lines = 3;
terminal = lib.getExe config.ar.home.defaultApps.terminal; terminal = lib.getExe config.ar.home.defaultApps.terminal;

View file

@ -13,7 +13,7 @@
borderSize = 2; borderSize = 2;
borderRadius = 10; borderRadius = 10;
defaultTimeout = 10000; defaultTimeout = 10000;
font = "${config.ar.home.theme.font.name} Regular ${toString config.ar.home.theme.font.size}"; font = "${config.gtk.font.name} Regular ${toString config.gtk.font.size}";
height = 300; height = 300;
layer = "top"; layer = "top";
padding = "15"; padding = "15";

View file

@ -15,7 +15,7 @@
caps-lock-key-hl-color=e78284 caps-lock-key-hl-color=e78284
color=303446 color=303446
daemonize daemonize
font="${config.ar.home.theme.terminalFont.name}-Regular" font="NotoSansMNerdFont-Regular"
image=${config.ar.home.theme.wallpaper} image=${config.ar.home.theme.wallpaper}
indicator-caps-lock indicator-caps-lock
indicator-idle-visible indicator-idle-visible

View file

@ -12,7 +12,7 @@
enableExtensionUpdateCheck = false; enableExtensionUpdateCheck = false;
userSettings = { userSettings = {
"diffEditor.ignoreTrimWhitespace" = false; "diffEditor.ignoreTrimWhitespace" = false;
"editor.fontFamily" = "'NotoSansM Nerd Font','${config.ar.home.theme.terminalFont.name}', 'monospace', monospace"; "editor.fontFamily" = "'NotoSansM Nerd Font', 'monospace', monospace";
"editor.fontSize" = lib.mkDefault 14; "editor.fontSize" = lib.mkDefault 14;
"editor.rulers" = [80]; "editor.rulers" = [80];
"explorer.confirmDelete" = false; "explorer.confirmDelete" = false;
@ -30,7 +30,7 @@
else "native"; else "native";
"window.zoomPerWindow" = false; "window.zoomPerWindow" = false;
"workbench.colorTheme" = "workbench.colorTheme" =
if config.ar.home.theme.colors.preferDark if config.ar.home.theme.darkMode
then "Adwaita Dark" then "Adwaita Dark"
else "Adwaita Light"; else "Adwaita Light";
"workbench.iconTheme" = "null"; "workbench.iconTheme" = "null";

View file

@ -172,44 +172,44 @@
xdg.configFile."waybar/style.css".text = '' xdg.configFile."waybar/style.css".text = ''
* { * {
border: none; border: none;
border-radius: 0; border-radius: 0;
font-family: "${config.ar.home.theme.terminalFont.name}"; font-family: "NotoSansM Nerd Font";
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
} }
window#waybar { window#waybar {
background: rgba (35, 38, 52, 0.0); background: rgba (35, 38, 52, 0.0);
color: ${config.ar.home.theme.colors.text}; color: ${config.ar.home.theme.colors.text};
} }
#workspaces button { #workspaces button {
padding: 0px 5px; padding: 0px 5px;
margin: 0 0px; margin: 0 0px;
color: ${config.ar.home.theme.colors.text}; color: ${config.ar.home.theme.colors.text};
} }
#workspaces button.active, #workspaces button.active,
#workspaces button.focused { #workspaces button.focused {
color: ${config.ar.home.theme.colors.primary}; color: ${config.ar.home.theme.colors.primary};
} }
#submap, #submap,
#mode { #mode {
padding: 0 15px; padding: 0 15px;
margin: 0 5px; margin: 0 5px;
color: #FFFFFF; color: #FFFFFF;
} }
#tags button { #tags button {
padding: 0px 5px; padding: 0px 5px;
margin: 0 0px; margin: 0 0px;
color: ${config.ar.home.theme.colors.text}; color: ${config.ar.home.theme.colors.text};
} }
#tags button.focused { #tags button.focused {
color: ${config.ar.home.theme.colors.primary}; color: ${config.ar.home.theme.colors.primary};
} }
#clock, #clock,
@ -224,8 +224,8 @@
#custom-menu, #custom-menu,
#custom-sway-close, #custom-sway-close,
#tray { #tray {
padding: 0 7.5px; padding: 0 7.5px;
margin: 0 5px; margin: 0 5px;
} }
#battery { #battery {
@ -251,11 +251,7 @@
#custom-hyprland-close, #custom-hyprland-close,
#hardware { #hardware {
border-radius: 10; border-radius: 10;
background: rgba ${ background: rgba (36, 36, 36, 0.8);
if config.ar.home.theme.colors.preferDark
then "(36, 36, 36, 0.8);"
else "(250, 250, 250, 0.8);"
}
margin: 5px 10px 0px 10px; margin: 5px 10px 0px 10px;
padding: 0px 10px 0px 10px; padding: 0px 10px 0px 10px;
} }

View file

@ -33,7 +33,7 @@
* { * {
background-image: none; background-image: none;
box-shadow: none; box-shadow: none;
font-family: "${config.ar.home.theme.font.name}", sans-serif; font-family: "${config.gtk.font.name}", sans-serif;
transition: 20ms; transition: 20ms;
} }

View file

@ -214,7 +214,7 @@
env = GDK_SCALE,${gdk_scale} env = GDK_SCALE,${gdk_scale}
# Some default env vars. # Some default env vars.
env = XCURSOR_SIZE,${toString config.ar.home.theme.cursorTheme.size} env = XCURSOR_SIZE,${toString config.home.pointerCursor.size}
env = QT_QPA_PLATFORMTHEME,qt6ct env = QT_QPA_PLATFORMTHEME,qt6ct
# Execute necessary apps # Execute necessary apps

View file

@ -115,9 +115,9 @@
# mouseWarping = "container"; # mouseWarping = "container";
}; };
fonts = { fonts = {
names = ["${config.ar.home.theme.font.name}"]; names = ["${config.gtk.font.name}"];
style = "Bold"; style = "Bold";
size = config.ar.home.theme.font.size + 0.0; size = config.gtk.font.size + 0.0;
}; };
gaps.inner = 5; gaps.inner = 5;
gaps.outer = 5; gaps.outer = 5;

View file

@ -235,121 +235,13 @@
theme = { theme = {
enable = lib.mkEnableOption "Gtk, Qt, and application colors."; enable = lib.mkEnableOption "Gtk, Qt, and application colors.";
gtk = { darkMode = lib.mkOption {
name = lib.mkOption { description = "Whether to prefer dark mode apps or not.";
description = "GTK theme name."; default = config.ar.home.theme.enable;
default = "adw-gtk3-dark"; type = lib.types.bool;
type = lib.types.str;
};
package = lib.mkOption {
description = "GTK theme package.";
default = pkgs.adw-gtk3;
type = lib.types.package;
};
hideTitleBar = lib.mkOption {
description = "Whether to hide GTK3/4 titlebars (useful for some window managers).";
default = false;
type = lib.types.bool;
};
};
qt = {
name = lib.mkOption {
description = "Qt theme name.";
default = "Adwaita-Dark";
type = lib.types.str;
};
package = lib.mkOption {
description = "Qt theme package.";
default = pkgs.adwaita-qt;
type = lib.types.package;
};
};
iconTheme = {
name = lib.mkOption {
description = "Icon theme name.";
default = "Papirus-Dark";
type = lib.types.str;
};
package = lib.mkOption {
description = "Icon theme package.";
default = pkgs.papirus-icon-theme;
type = lib.types.package;
};
};
cursorTheme = {
name = lib.mkOption {
description = "Cursor theme name.";
default = "Bibata-Modern-Classic";
type = lib.types.str;
};
size = lib.mkOption {
description = "Cursor size.";
default = 20;
type = lib.types.int;
};
package = lib.mkOption {
description = "Cursor theme package.";
default = pkgs.bibata-cursors;
type = lib.types.package;
};
};
font = {
name = lib.mkOption {
description = "Font name.";
default = "NotoSans Nerd Font";
type = lib.types.str;
};
size = lib.mkOption {
description = "Font size.";
default = 11;
type = lib.types.int;
};
package = lib.mkOption {
description = "Font package.";
default = pkgs.nerdfonts;
type = lib.types.package;
};
};
terminalFont = {
name = lib.mkOption {
description = "Font name.";
default = "NotoSansM Nerd Font";
type = lib.types.str;
};
size = lib.mkOption {
description = "Font size.";
default = 11;
type = lib.types.int;
};
package = lib.mkOption {
description = "Font package.";
default = pkgs.nerdfonts;
type = lib.types.package;
};
}; };
colors = { colors = {
preferDark = lib.mkOption {
description = "Whether to prefer dark mode apps or not.";
default = config.ar.home.theme.enable;
type = lib.types.bool;
};
text = lib.mkOption { text = lib.mkOption {
description = "Text color."; description = "Text color.";
default = "#FFFFFF"; default = "#FFFFFF";
@ -387,6 +279,12 @@
}; };
}; };
gtk.hideTitleBar = lib.mkOption {
description = "Whether to hide GTK3/4 titlebars (useful for some window managers).";
default = false;
type = lib.types.bool;
};
wallpaper = lib.mkOption { wallpaper = lib.mkOption {
description = "Default wallpaper."; description = "Default wallpaper.";
default = "${config.xdg.dataHome}/backgrounds/jr-korpa-9XngoIpxcEo-unsplash.jpg"; default = "${config.xdg.dataHome}/backgrounds/jr-korpa-9XngoIpxcEo-unsplash.jpg";

View file

@ -10,32 +10,23 @@
pointerCursor = { pointerCursor = {
gtk.enable = true; gtk.enable = true;
name = config.ar.home.theme.cursorTheme.name; name = "Bibata-Modern-Classic";
package = config.ar.home.theme.cursorTheme.package; package = pkgs.bibata-cursors;
size = config.ar.home.theme.cursorTheme.size; size = lib.mkDefault 20;
x11 = { x11 = {
enable = true; enable = true;
defaultCursor = config.ar.home.theme.cursorTheme.name; defaultCursor = config.home.pointerCursor.name;
}; };
}; };
}; };
qt = {
enable = true;
platformTheme.name = "qtct";
style = {
package = config.ar.home.theme.qt.package;
name = config.ar.home.theme.qt.name;
};
};
fonts.fontconfig = { fonts.fontconfig = {
enable = true; enable = true;
defaultFonts = { defaultFonts = {
monospace = [config.ar.home.theme.terminalFont.name]; monospace = ["NotoSansM Nerd Font"];
serif = ["NotoSerif Nerd Font"]; serif = ["NotoSerif Nerd Font"];
sansSerif = [config.ar.home.theme.font.name]; sansSerif = [config.gtk.font.name];
}; };
}; };
@ -43,24 +34,30 @@
enable = true; enable = true;
theme = { theme = {
package = config.ar.home.theme.gtk.package; package = pkgs.adw-gtk3;
name = config.ar.home.theme.gtk.name; name =
if config.ar.home.theme.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
}; };
iconTheme = { iconTheme = {
package = config.ar.home.theme.iconTheme.package; package = pkgs.papirus-icon-theme;
name = config.ar.home.theme.iconTheme.name; name =
if config.ar.home.theme.darkMode
then "Papirus-Dark"
else "Papirus";
}; };
font = { font = {
name = "${config.ar.home.theme.font.name} Regular"; name = "NotoSans Nerd Font";
package = config.ar.home.theme.font.package; package = pkgs.nerdfonts;
size = config.ar.home.theme.font.size; size = lib.mkDefault 11;
}; };
gtk3.extraConfig = lib.attrsets.optionalAttrs (config.ar.home.theme.colors.preferDark) {gtk-application-prefer-dark-theme = 1;}; gtk3.extraConfig = lib.attrsets.optionalAttrs (config.ar.home.theme.darkMode) {gtk-application-prefer-dark-theme = 1;};
gtk4.extraConfig = lib.attrsets.optionalAttrs (config.ar.home.theme.colors.preferDark) {gtk-application-prefer-dark-theme = 1;}; gtk4.extraConfig = lib.attrsets.optionalAttrs (config.ar.home.theme.darkMode) {gtk-application-prefer-dark-theme = 1;};
gtk3.extraCss = '' gtk3.extraCss = ''
@define-color accent_bg_color ${config.ar.home.theme.colors.primary}; @define-color accent_bg_color ${config.ar.home.theme.colors.primary};
@ -96,35 +93,74 @@
gtk4.extraCss = config.gtk.gtk3.extraCss; gtk4.extraCss = config.gtk.gtk3.extraCss;
}; };
qt = {
enable = true;
platformTheme.name = "qtct";
style = {
package = pkgs.adwaita-qt;
name =
if config.ar.home.theme.darkMode
then "Adwaita Dark"
else "Adwaita";
};
};
dconf.settings = { dconf.settings = {
"org/cinnamon/desktop/background".picture-uri = "file://${config.ar.home.theme.wallpaper}"; "org/cinnamon/desktop/background".picture-uri = "file://${config.ar.home.theme.wallpaper}";
"org/cinnamon/desktop/interface" = { "org/cinnamon/desktop/interface" = {
cursor-size = config.ar.home.theme.cursorTheme.size; cursor-size = config.home.pointerCursor.size;
cursor-theme = config.ar.home.theme.cursorTheme.name; cursor-theme = config.home.pointerCursor.name;
font-name = "${config.ar.home.theme.font.name} Regular ${toString config.ar.home.theme.font.size}"; font-name = "${config.gtk.font.name} ${toString config.gtk.font.size}";
gtk-theme = config.ar.home.theme.gtk.name;
icon-theme = config.ar.home.theme.iconTheme.name; gtk-theme =
if config.ar.home.theme.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
icon-theme =
if config.ar.home.theme.darkMode
then "Papirus-Dark"
else "Papirus";
}; };
"org/cinnamon/theme".name = config.ar.home.theme.gtk.name; "org/cinnamon/theme".name =
"org/cinnamon/desktop/wm/preferences".titlebar-font = "${config.ar.home.theme.font.name} ${toString config.ar.home.theme.font.size}"; if config.ar.home.theme.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
"org/cinnamon/desktop/wm/preferences".titlebar-font = "${config.gtk.font.name} ${toString config.gtk.font.size}";
"org/gnome/desktop/background" = {
picture-uri = "file://${config.ar.home.theme.wallpaper}";
picture-uri-dark = "file://${config.ar.home.theme.wallpaper}";
};
"org/gnome/desktop/background".picture-uri = "file://${config.ar.home.theme.wallpaper}";
"org/gnome/desktop/background".picture-uri-dark = "file://${config.ar.home.theme.wallpaper}";
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
color-scheme = color-scheme =
if config.ar.home.theme.colors.preferDark if config.ar.home.theme.darkMode
then "prefer-dark" then "prefer-dark"
else "prefer-light"; else "prefer-light";
cursor-theme = config.ar.home.theme.cursorTheme.name;
cursor-size = config.ar.home.theme.cursorTheme.size; cursor-theme = config.home.pointerCursor.name;
gtk-theme = config.ar.home.theme.gtk.name; cursor-size = config.home.pointerCursor.size;
icon-theme = config.ar.home.theme.iconTheme.name;
monospace-font-name = "${config.ar.home.theme.terminalFont.name} Regular ${toString config.ar.home.theme.terminalFont.size}"; document-font-name = "NotoSerif Nerd Font ${toString config.gtk.font.size}";
gtk-theme =
if config.ar.home.theme.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
icon-theme =
if config.ar.home.theme.darkMode
then "Papirus-Dark"
else "Papirus";
monospace-font-name = "NotoSansM Nerd Font ${toString config.gtk.font.size}";
}; };
"org/gnome/desktop/wm/preferences".titlebar-font = "${config.ar.home.theme.font.name} ${toString config.ar.home.theme.font.size}"; "org/gnome/desktop/wm/preferences".titlebar-font = "${config.gtk.font.name} ${toString config.gtk.font.size}";
}; };
}; };
} }

View file

@ -11,16 +11,16 @@
programs.vscode.userSettings = { programs.vscode.userSettings = {
"editor.fontSize" = lib.mkForce "16"; "editor.fontSize" = lib.mkForce "16";
}; };
home.pointerCursor.size = lib.mkForce 24;
gtk.font.size = lib.mkForce 14;
ar.home = { ar.home = {
services.easyeffects = { services.easyeffects = {
enable = true; enable = true;
preset = "LoudnessEqualizer"; preset = "LoudnessEqualizer";
}; };
theme = {
cursorTheme.size = lib.mkForce 24;
font.size = lib.mkForce 14;
terminalFont.size = lib.mkForce 14;
};
}; };
} }
]; ];