home/theme: imrpove readability

This commit is contained in:
Aly Raffauf 2024-07-07 01:51:26 -04:00
parent b9af8abe95
commit ba351c050c

View file

@ -4,163 +4,166 @@
config, config,
... ...
}: { }: {
config = lib.mkIf config.ar.home.theme.enable { config = let
home = { cfg = config.ar.home.theme;
packages = with pkgs; [gnome.adwaita-icon-theme]; in
lib.mkIf cfg.enable {
home = {
packages = with pkgs; [gnome.adwaita-icon-theme];
pointerCursor = { pointerCursor = {
gtk.enable = true; gtk.enable = true;
name = "Bibata-Modern-Classic"; name = "Bibata-Modern-Classic";
package = pkgs.bibata-cursors; package = pkgs.bibata-cursors;
size = lib.mkDefault 20; size = lib.mkDefault 20;
x11 = { x11 = {
enable = true; enable = true;
defaultCursor = config.home.pointerCursor.name; defaultCursor = config.home.pointerCursor.name;
};
}; };
}; };
};
fonts.fontconfig = { fonts.fontconfig = {
enable = true; enable = true;
defaultFonts = { defaultFonts = {
monospace = ["NotoSansM Nerd Font"]; monospace = ["NotoSansM Nerd Font"];
serif = ["NotoSerif Nerd Font"]; serif = ["NotoSerif Nerd Font"];
sansSerif = [config.gtk.font.name]; sansSerif = [config.gtk.font.name];
}; };
};
gtk = {
enable = true;
theme = {
package = pkgs.adw-gtk3;
name =
if config.ar.home.theme.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
}; };
iconTheme = { gtk = {
package = pkgs.papirus-icon-theme; enable = true;
name =
if config.ar.home.theme.darkMode theme = {
then "Papirus-Dark" package = pkgs.adw-gtk3;
else "Papirus"; name =
if cfg.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
};
iconTheme = {
package = pkgs.papirus-icon-theme;
name =
if cfg.darkMode
then "Papirus-Dark"
else "Papirus";
};
font = {
name = "NotoSans Nerd Font";
package = pkgs.nerdfonts;
size = lib.mkDefault 11;
};
gtk3.extraConfig = lib.attrsets.optionalAttrs (cfg.darkMode) {gtk-application-prefer-dark-theme = 1;};
gtk4.extraConfig = lib.attrsets.optionalAttrs (cfg.darkMode) {gtk-application-prefer-dark-theme = 1;};
gtk3.extraCss = ''
@define-color accent_bg_color ${cfg.colors.primary};
@define-color accent_color @accent_bg_color;
${
lib.strings.optionalString
cfg.gtk.hideTitleBar
''
/* No (default) title bar on wayland */
headerbar.default-decoration {
/* You may need to tweak these values depending on your GTK theme */
margin-bottom: 50px;
margin-top: -100px;
background: transparent;
padding: 0;
border: 0;
min-height: 0;
font-size: 0;
box-shadow: none;
}
/* rm -rf window shadows */
window.csd, /* gtk4? */
window.csd decoration { /* gtk3 */
box-shadow: none;
}
''
}
'';
gtk4.extraCss = config.gtk.gtk3.extraCss;
}; };
font = { qt = {
name = "NotoSans Nerd Font"; enable = true;
package = pkgs.nerdfonts; platformTheme.name = "qtct";
size = lib.mkDefault 11; style = {
package = pkgs.adwaita-qt;
name =
if cfg.darkMode
then "Adwaita-Dark"
else "Adwaita";
};
}; };
gtk3.extraConfig = lib.attrsets.optionalAttrs (config.ar.home.theme.darkMode) {gtk-application-prefer-dark-theme = 1;}; dconf.settings = {
"org/cinnamon/desktop/background".picture-uri = "file://${cfg.wallpaper}";
gtk4.extraConfig = lib.attrsets.optionalAttrs (config.ar.home.theme.darkMode) {gtk-application-prefer-dark-theme = 1;}; "org/cinnamon/desktop/interface" = {
cursor-size = config.home.pointerCursor.size;
cursor-theme = config.home.pointerCursor.name;
font-name = "${config.gtk.font.name} ${toString config.gtk.font.size}";
gtk3.extraCss = '' gtk-theme =
@define-color accent_bg_color ${config.ar.home.theme.colors.primary}; if cfg.darkMode
@define-color accent_color @accent_bg_color; then "adw-gtk3-dark"
else "adw-gtk3";
${ icon-theme =
lib.strings.optionalString if cfg.darkMode
config.ar.home.theme.gtk.hideTitleBar then "Papirus-Dark"
'' else "Papirus";
/* No (default) title bar on wayland */ };
headerbar.default-decoration {
/* You may need to tweak these values depending on your GTK theme */
margin-bottom: 50px;
margin-top: -100px;
background: transparent; "org/cinnamon/theme".name =
padding: 0; if cfg.darkMode
border: 0;
min-height: 0;
font-size: 0;
box-shadow: none;
}
/* rm -rf window shadows */
window.csd, /* gtk4? */
window.csd decoration { /* gtk3 */
box-shadow: none;
}
''
}
'';
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 = {
"org/cinnamon/desktop/background".picture-uri = "file://${config.ar.home.theme.wallpaper}";
"org/cinnamon/desktop/interface" = {
cursor-size = config.home.pointerCursor.size;
cursor-theme = config.home.pointerCursor.name;
font-name = "${config.gtk.font.name} ${toString config.gtk.font.size}";
gtk-theme =
if config.ar.home.theme.darkMode
then "adw-gtk3-dark" then "adw-gtk3-dark"
else "adw-gtk3"; else "adw-gtk3";
icon-theme = "org/cinnamon/desktop/wm/preferences".titlebar-font = "${config.gtk.font.name} ${toString config.gtk.font.size}";
if config.ar.home.theme.darkMode
then "Papirus-Dark" "org/gnome/desktop/background" = {
else "Papirus"; picture-uri = "file://${cfg.wallpaper}";
picture-uri-dark = "file://${cfg.wallpaper}";
};
"org/gnome/desktop/interface" = {
color-scheme =
if cfg.darkMode
then "prefer-dark"
else "prefer-light";
cursor-theme = config.home.pointerCursor.name;
cursor-size = config.home.pointerCursor.size;
document-font-name = "NotoSerif Nerd Font ${toString config.gtk.font.size}";
gtk-theme =
if cfg.darkMode
then "adw-gtk3-dark"
else "adw-gtk3";
icon-theme =
if cfg.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.gtk.font.name} ${toString config.gtk.font.size}";
}; };
"org/cinnamon/theme".name =
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/interface" = {
color-scheme =
if config.ar.home.theme.darkMode
then "prefer-dark"
else "prefer-light";
cursor-theme = config.home.pointerCursor.name;
cursor-size = config.home.pointerCursor.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.gtk.font.name} ${toString config.gtk.font.size}";
}; };
};
} }