diff --git a/modules/style/gtk-colors.nix b/modules/style/gtk-colors.nix new file mode 100644 index 0000000..b714eed --- /dev/null +++ b/modules/style/gtk-colors.nix @@ -0,0 +1,92 @@ +# blatantly stolen from sioodmy, thanks :3 +{colors}: +with colors; '' + @define-color accent_color #${base0D}; + @define-color accent_bg_color #${base0D}; + @define-color accent_fg_color #${base00}; + @define-color destructive_color #${base08}; + @define-color destructive_bg_color #${base08}; + @define-color destructive_fg_color #${base00}; + @define-color success_color #${base0B}; + @define-color success_bg_color #${base0B}; + @define-color success_fg_color #${base00}; + @define-color warning_color #${base0E}; + @define-color warning_bg_color #${base0E}; + @define-color warning_fg_color #${base00}; + @define-color error_color #${base08}; + @define-color error_bg_color #${base08}; + @define-color error_fg_color #${base00}; + @define-color window_bg_color #${base00}; + @define-color window_fg_color #${base05}; + @define-color view_bg_color #${base00}; + @define-color view_fg_color #${base05}; + @define-color headerbar_bg_color #${base01}; + @define-color headerbar_fg_color #${base05}; + @define-color headerbar_border_color #${base01}; + @define-color headerbar_backdrop_color @window_bg_color; + @define-color headerbar_shade_color rgba(0, 0, 0, 0.07); + @define-color headerbar_darker_shade_color rgba(0, 0, 0, 0.07); + @define-color sidebar_bg_color #${base01}; + @define-color sidebar_fg_color #${base05}; + @define-color sidebar_backdrop_color @window_bg_color; + @define-color sidebar_shade_color rgba(0, 0, 0, 0.07); + @define-color secondary_sidebar_bg_color @sidebar_bg_color; + @define-color secondary_sidebar_fg_color @sidebar_fg_color; + @define-color secondary_sidebar_backdrop_color @sidebar_backdrop_color; + @define-color secondary_sidebar_shade_color @sidebar_shade_color; + @define-color card_bg_color #${base01}; + @define-color card_fg_color #${base05}; + @define-color card_shade_color rgba(0, 0, 0, 0.07); + @define-color dialog_bg_color #${base01}; + @define-color dialog_fg_color #${base05}; + @define-color popover_bg_color #${base01}; + @define-color popover_fg_color #${base05}; + @define-color popover_shade_color rgba(0, 0, 0, 0.07); + @define-color shade_color rgba(0, 0, 0, 0.07); + @define-color scrollbar_outline_color #${base02}; + @define-color blue_1 #${base0D}; + @define-color blue_2 #${base0D}; + @define-color blue_3 #${base0D}; + @define-color blue_4 #${base0D}; + @define-color blue_5 #${base0D}; + @define-color green_1 #${base0B}; + @define-color green_2 #${base0B}; + @define-color green_3 #${base0B}; + @define-color green_4 #${base0B}; + @define-color green_5 #${base0B}; + @define-color yellow_1 #${base0A}; + @define-color yellow_2 #${base0A}; + @define-color yellow_3 #${base0A}; + @define-color yellow_4 #${base0A}; + @define-color yellow_5 #${base0A}; + @define-color orange_1 #${base09}; + @define-color orange_2 #${base09}; + @define-color orange_3 #${base09}; + @define-color orange_4 #${base09}; + @define-color orange_5 #${base09}; + @define-color red_1 #${base08}; + @define-color red_2 #${base08}; + @define-color red_3 #${base08}; + @define-color red_4 #${base08}; + @define-color red_5 #${base08}; + @define-color purple_1 #${base0E}; + @define-color purple_2 #${base0E}; + @define-color purple_3 #${base0E}; + @define-color purple_4 #${base0E}; + @define-color purple_5 #${base0E}; + @define-color brown_1 #${base0F}; + @define-color brown_2 #${base0F}; + @define-color brown_3 #${base0F}; + @define-color brown_4 #${base0F}; + @define-color brown_5 #${base0F}; + @define-color light_1 #${base01}; + @define-color light_2 #${base01}; + @define-color light_3 #${base01}; + @define-color light_4 #${base01}; + @define-color light_5 #${base01}; + @define-color dark_1 #${base01}; + @define-color dark_2 #${base01}; + @define-color dark_3 #${base01}; + @define-color dark_4 #${base01}; + @define-color dark_5 #${base01}; +'' diff --git a/modules/style/gtk.nix b/modules/style/gtk.nix index 3a09c87..c1b5983 100644 --- a/modules/style/gtk.nix +++ b/modules/style/gtk.nix @@ -6,11 +6,11 @@ }: let inherit (builtins) toString isBool; inherit (lib.generators) toINI; - inherit (lib.modules) mkMerge mkIf; + inherit (lib.modules) mkIf; inherit (lib.options) mkOption mkEnableOption; - inherit (lib.types) str package; inherit (lib.strings) escape; inherit (lib.trivial) boolToString; + inherit (lib.types) str package; cfg = config.modules.theming.gtk; @@ -75,23 +75,28 @@ in { rose-pine-cursor gruvbox-gtk-theme papirus-icon-theme + colloid-icon-theme ; }; variables = { GTK_THEME = cfg.theme.name; XCURSOR_THEME = "BreezeX-RosePine-Linux"; - XCURSOR_SIZE = toString cursorSize; + XCURSOR_SIZE = cursorSize; HYPRCURSOR_THEME = "BreezeX-RosePine-Linux"; - HYPRCURSOR_SIZE = toString cursorSize; + HYPRCURSOR_SIZE = cursorSize; }; - etc = { + etc = let + css = import ./gtk-colors.nix {inherit (config.modules.style.colorScheme) colors;}; + in { "xdg/gtk-4.0/settings.ini".text = toGtk3Ini { Settings = gtkIni; }; "xdg/gtk-3.0/settings.ini".text = toGtk3Ini { Settings = gtkIni; }; + "xdg/gtk-4.0/gtk.css".text = css; + "xdg/gtk-3.0/gtk.css".text = css; "xdg/gtk-2.0/gtkrc".text = '' gtk-cursor-theme-name = BreezeX-RosePine-Linux