regreet: explicitly apply GTK theme (#1964)
Explicitly apply the GTK theme, as global GTK theming is scoped to
individual derivations.
Closes: https://github.com/nix-community/stylix/issues/690
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
(cherry picked from commit 687a8c1bf2)
This commit is contained in:
parent
b5072c5130
commit
9bf8725a3d
3 changed files with 127 additions and 1 deletions
88
modules/regreet/gtk.css.mustache
Normal file
88
modules/regreet/gtk.css.mustache
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
@define-color accent_color #{{base0D-hex}};
|
||||
@define-color accent_bg_color #{{base0D-hex}};
|
||||
@define-color accent_fg_color #{{base00-hex}};
|
||||
@define-color destructive_color #{{base08-hex}};
|
||||
@define-color destructive_bg_color #{{base08-hex}};
|
||||
@define-color destructive_fg_color #{{base00-hex}};
|
||||
@define-color success_color #{{base0B-hex}};
|
||||
@define-color success_bg_color #{{base0B-hex}};
|
||||
@define-color success_fg_color #{{base00-hex}};
|
||||
@define-color warning_color #{{base0E-hex}};
|
||||
@define-color warning_bg_color #{{base0E-hex}};
|
||||
@define-color warning_fg_color #{{base00-hex}};
|
||||
@define-color error_color #{{base08-hex}};
|
||||
@define-color error_bg_color #{{base08-hex}};
|
||||
@define-color error_fg_color #{{base00-hex}};
|
||||
@define-color window_bg_color #{{base00-hex}};
|
||||
@define-color window_fg_color #{{base05-hex}};
|
||||
@define-color view_bg_color #{{base00-hex}};
|
||||
@define-color view_fg_color #{{base05-hex}};
|
||||
@define-color headerbar_bg_color #{{base01-hex}};
|
||||
@define-color headerbar_fg_color #{{base05-hex}};
|
||||
@define-color headerbar_border_color rgba({{base01-dec-r}}, {{base01-dec-g}}, {{base01-dec-b}}, 0.7);
|
||||
@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-hex}};
|
||||
@define-color sidebar_fg_color #{{base05-hex}};
|
||||
@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-hex}};
|
||||
@define-color card_fg_color #{{base05-hex}};
|
||||
@define-color card_shade_color rgba(0, 0, 0, 0.07);
|
||||
@define-color dialog_bg_color #{{base01-hex}};
|
||||
@define-color dialog_fg_color #{{base05-hex}};
|
||||
@define-color popover_bg_color #{{base01-hex}};
|
||||
@define-color popover_fg_color #{{base05-hex}};
|
||||
@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-hex}};
|
||||
@define-color blue_1 #{{base0D-hex}};
|
||||
@define-color blue_2 #{{base0D-hex}};
|
||||
@define-color blue_3 #{{base0D-hex}};
|
||||
@define-color blue_4 #{{base0D-hex}};
|
||||
@define-color blue_5 #{{base0D-hex}};
|
||||
@define-color green_1 #{{base0B-hex}};
|
||||
@define-color green_2 #{{base0B-hex}};
|
||||
@define-color green_3 #{{base0B-hex}};
|
||||
@define-color green_4 #{{base0B-hex}};
|
||||
@define-color green_5 #{{base0B-hex}};
|
||||
@define-color yellow_1 #{{base0A-hex}};
|
||||
@define-color yellow_2 #{{base0A-hex}};
|
||||
@define-color yellow_3 #{{base0A-hex}};
|
||||
@define-color yellow_4 #{{base0A-hex}};
|
||||
@define-color yellow_5 #{{base0A-hex}};
|
||||
@define-color orange_1 #{{base09-hex}};
|
||||
@define-color orange_2 #{{base09-hex}};
|
||||
@define-color orange_3 #{{base09-hex}};
|
||||
@define-color orange_4 #{{base09-hex}};
|
||||
@define-color orange_5 #{{base09-hex}};
|
||||
@define-color red_1 #{{base08-hex}};
|
||||
@define-color red_2 #{{base08-hex}};
|
||||
@define-color red_3 #{{base08-hex}};
|
||||
@define-color red_4 #{{base08-hex}};
|
||||
@define-color red_5 #{{base08-hex}};
|
||||
@define-color purple_1 #{{base0E-hex}};
|
||||
@define-color purple_2 #{{base0E-hex}};
|
||||
@define-color purple_3 #{{base0E-hex}};
|
||||
@define-color purple_4 #{{base0E-hex}};
|
||||
@define-color purple_5 #{{base0E-hex}};
|
||||
@define-color brown_1 #{{base0F-hex}};
|
||||
@define-color brown_2 #{{base0F-hex}};
|
||||
@define-color brown_3 #{{base0F-hex}};
|
||||
@define-color brown_4 #{{base0F-hex}};
|
||||
@define-color brown_5 #{{base0F-hex}};
|
||||
@define-color light_1 #{{base05-hex}};
|
||||
@define-color light_2 #{{base05-hex}};
|
||||
@define-color light_3 #{{base05-hex}};
|
||||
@define-color light_4 #{{base05-hex}};
|
||||
@define-color light_5 #{{base05-hex}};
|
||||
@define-color dark_1 #{{base05-hex}};
|
||||
@define-color dark_2 #{{base05-hex}};
|
||||
@define-color dark_3 #{{base05-hex}};
|
||||
@define-color dark_4 #{{base05-hex}};
|
||||
@define-color dark_5 #{{base05-hex}};
|
||||
|
|
@ -12,7 +12,17 @@ mkTarget {
|
|||
autoEnable = pkgs.stdenv.hostPlatform.isLinux;
|
||||
autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux";
|
||||
|
||||
extraOptions.useWallpaper = config.lib.stylix.mkEnableWallpaper "ReGreet" true;
|
||||
extraOptions = {
|
||||
useWallpaper = config.lib.stylix.mkEnableWallpaper "ReGreet" true;
|
||||
extraCss = lib.mkOption {
|
||||
description = ''
|
||||
Extra code added to `programs.regreet.extraCss` option.
|
||||
'';
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
example = "window.background { border-radius: 0; }";
|
||||
};
|
||||
};
|
||||
|
||||
configElements = [
|
||||
{
|
||||
|
|
@ -34,6 +44,24 @@ mkTarget {
|
|||
name = "adw-gtk3";
|
||||
};
|
||||
}
|
||||
(
|
||||
{ cfg, colors }:
|
||||
let
|
||||
baseCss = colors {
|
||||
# This is strongly inspired by ../gtk/gtk.mustache.
|
||||
template = ./gtk.css.mustache;
|
||||
extension = ".css";
|
||||
};
|
||||
|
||||
finalCss = pkgs.runCommandLocal "gtk.css" { } ''
|
||||
cat ${baseCss} >>$out
|
||||
echo ${lib.escapeShellArg cfg.extraCss} >>$out
|
||||
'';
|
||||
in
|
||||
{
|
||||
programs.regreet.extraCss = finalCss.outPath;
|
||||
}
|
||||
)
|
||||
(
|
||||
{ polarity }:
|
||||
{
|
||||
|
|
@ -79,5 +107,14 @@ mkTarget {
|
|||
};
|
||||
}
|
||||
)
|
||||
(
|
||||
{ polarity, icons }:
|
||||
{
|
||||
programs.regreet.iconTheme = {
|
||||
inherit (icons) package;
|
||||
name = if (polarity == "dark") then icons.dark else icons.light;
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
|
|
|||
1
modules/regreet/testbeds/regreet.nix
Normal file
1
modules/regreet/testbeds/regreet.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ programs.regreet.enable = true; }
|
||||
Loading…
Add table
Add a link
Reference in a new issue