feat(home-manager): add gnomeShellTheme
option for gtk (#161)
* feat(home-manager/gtk): add gnome option Add an option to set the gtk theme as gnome shell's theme using the user-theme gnome extension * implemented feedbacks * style(home-manager): format gtk module --------- Co-authored-by: seth <getchoo@tuta.io>
This commit is contained in:
parent
a2b462f913
commit
5e0f749a08
1 changed files with 23 additions and 2 deletions
|
@ -4,7 +4,7 @@
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) ctp mkOption types;
|
inherit (lib) ctp mkOption mkEnableOption types;
|
||||||
cfg = config.gtk.catppuccin;
|
cfg = config.gtk.catppuccin;
|
||||||
enable = cfg.enable && config.gtk.enable;
|
enable = cfg.enable && config.gtk.enable;
|
||||||
# "dark" and "light" can be used alongside the regular accents
|
# "dark" and "light" can be used alongside the regular accents
|
||||||
|
@ -25,6 +25,7 @@ in
|
||||||
default = [ "normal" ];
|
default = [ "normal" ];
|
||||||
description = "Catppuccin tweaks for gtk";
|
description = "Catppuccin tweaks for gtk";
|
||||||
};
|
};
|
||||||
|
gnomeShellTheme = mkEnableOption "Catppuccin gtk theme for GNOME Shell";
|
||||||
|
|
||||||
cursor = ctp.mkCatppuccinOpt "gtk cursors"
|
cursor = ctp.mkCatppuccinOpt "gtk cursors"
|
||||||
// {
|
// {
|
||||||
|
@ -34,7 +35,7 @@ in
|
||||||
|
|
||||||
config = lib.mkIf enable {
|
config = lib.mkIf enable {
|
||||||
assertions = [
|
assertions = [
|
||||||
(lib.ctp.assertXdgEnabled "gtk")
|
(ctp.assertXdgEnabled "gtk")
|
||||||
];
|
];
|
||||||
|
|
||||||
gtk = {
|
gtk = {
|
||||||
|
@ -79,5 +80,25 @@ in
|
||||||
"gtk-4.0/gtk.css".source = "${gtk4Dir}/gtk.css";
|
"gtk-4.0/gtk.css".source = "${gtk4Dir}/gtk.css";
|
||||||
"gtk-4.0/gtk-dark.css".source = "${gtk4Dir}/gtk-dark.css";
|
"gtk-4.0/gtk-dark.css".source = "${gtk4Dir}/gtk-dark.css";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.packages = lib.mkIf cfg.gnomeShellTheme [ pkgs.gnomeExtensions.user-themes ];
|
||||||
|
|
||||||
|
dconf.settings = lib.mkIf cfg.gnomeShellTheme {
|
||||||
|
"org/gnome/shell" = {
|
||||||
|
disable-user-extensions = false;
|
||||||
|
enabled-extensions = [
|
||||||
|
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"org/gnome/shell/extensions/user-theme" = {
|
||||||
|
name = config.gtk.theme.name;
|
||||||
|
};
|
||||||
|
"org/gnome/desktop/interface" = {
|
||||||
|
color-scheme =
|
||||||
|
if cfg.flavour == "latte"
|
||||||
|
then "default"
|
||||||
|
else "prefer-dark";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue