nixdots/home/themes/gtk.nix

96 lines
2.3 KiB
Nix
Raw Permalink Normal View History

{
osConfig,
config,
pkgs,
...
}: let
cfg = osConfig.myOptions.home-manager.theme.gtk;
in {
home = {
packages = with pkgs; [
glib # gsettings
cfg.theme.package
cfg.iconTheme.package
];
sessionVariables = {
# set GTK theme to the name specified by the gtk theme package
GTK_THEME = "${cfg.theme.name}";
# gtk applications should use filepickers specified by xdg
2024-07-26 23:07:07 +00:00
GTK_USE_PORTAL = "${toString (
if cfg.usePortal
then 1
else 0
)}";
};
};
gtk = {
enable = true;
theme = {
name = cfg.theme.name;
package = cfg.theme.package;
};
iconTheme = {
name = cfg.iconTheme.name;
package = cfg.iconTheme.package;
};
font = {
name = cfg.font.name;
size = cfg.font.size;
};
gtk2 = {
configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
extraConfig = ''
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"
'';
};
gtk3.extraConfig = {
gtk-toolbar-style = "GTK_TOOLBAR_BOTH";
gtk-toolbar-icon-size = "GTK_ICON_SIZE_LARGE_TOOLBAR";
gtk-decoration-layout = "appmenu:none";
gtk-button-images = 1;
gtk-menu-images = 1;
gtk-enable-event-sounds = 0;
gtk-enable-input-feedback-sounds = 0;
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintslight";
gtk-error-bell = 0;
gtk-application-prefer-dark-theme = true;
};
gtk4.extraConfig = {
gtk-decoration-layout = "appmenu:none";
gtk-enable-event-sounds = 0;
gtk-enable-input-feedback-sounds = 0;
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintslight";
gtk-error-bell = 0;
gtk-application-prefer-dark-theme = true;
};
};
2024-06-23 16:11:45 +00:00
dconf.settings = {
2024-06-24 17:16:14 +00:00
# This is like a system-wide dark mode switch that some apps respect it.
# Equivalent of the following dconf command:
# `conf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"`
"org/gnome/desktop/interface".color-scheme = "prefer-dark";
2024-06-23 16:11:45 +00:00
"org/gnome/desktop/interface".gtk-theme = cfg.theme.name;
2024-06-23 16:11:45 +00:00
# For Gnome shell
"org/gnome/shell/extensions/user-theme".name = cfg.theme.name;
};
}