theming
This commit is contained in:
parent
448372de7a
commit
ffa3121602
11 changed files with 243 additions and 38 deletions
71
home-modules/xun/desktop/colorscheme/default.nix
Normal file
71
home-modules/xun/desktop/colorscheme/default.nix
Normal file
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.xun.desktop;
|
||||
dark = {
|
||||
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
|
||||
gtk = {
|
||||
theme = {
|
||||
package = pkgs.gnome-themes-extra;
|
||||
name = "Adwaita-dark";
|
||||
};
|
||||
iconTheme = {
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
name = "Adwaita-dark";
|
||||
};
|
||||
gtk2.extraConfig = "gtk-application-prefer-dark-theme=1";
|
||||
gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;
|
||||
gtk4.extraConfig.gtk-application-prefer-dark-theme = 1;
|
||||
};
|
||||
qt = {
|
||||
platformTheme.name = "gtk3";
|
||||
style = {
|
||||
name = "Adwaita-dark";
|
||||
package = pkgs.adwaita-qt;
|
||||
};
|
||||
};
|
||||
};
|
||||
light = {
|
||||
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-light";
|
||||
gtk = {
|
||||
theme = {
|
||||
package = pkgs.gnome-themes-extra;
|
||||
name = "Adwaita";
|
||||
};
|
||||
iconTheme = {
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
name = "Adwaita";
|
||||
};
|
||||
gtk2.extraConfig = "gtk-application-prefer-dark-theme=false";
|
||||
gtk3.extraConfig.gtk-application-prefer-dark-theme = 0;
|
||||
gtk4.extraConfig.gtk-application-prefer-dark-theme = 0;
|
||||
};
|
||||
qt = {
|
||||
style = {
|
||||
name = "adwaita";
|
||||
package = pkgs.adwaita-qt;
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.xun.desktop.colorscheme = lib.mkOption {
|
||||
default = null;
|
||||
type = lib.types.enum [null "dark" "light"]; # might add more in the future
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.colorscheme != null) (lib.mkMerge [
|
||||
(lib.mkIf (cfg.colorscheme == "dark") dark)
|
||||
(lib.mkIf (cfg.colorscheme == "light") light)
|
||||
]);
|
||||
|
||||
# config = lib.mkIf (cfg.colorscheme != null) (let
|
||||
# switch = {
|
||||
# dark = {};
|
||||
# light = {};
|
||||
# };
|
||||
# in
|
||||
# switch."${toString cfg.colorscheme}");
|
||||
}
|
|
@ -6,11 +6,27 @@
|
|||
}: let
|
||||
cfg = config.xun.desktop;
|
||||
in {
|
||||
imports = [
|
||||
./colorscheme
|
||||
];
|
||||
|
||||
options.xun.desktop = {
|
||||
xdg.enable = lib.mkEnableOption "xdg env vars";
|
||||
# colorscheme = lib.mkOption {
|
||||
# default = null;
|
||||
# type = lib.types.enum ["dark" "light"];
|
||||
# };
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
# (let
|
||||
# switch = {
|
||||
# "dark" = {};
|
||||
# "light" = {};
|
||||
# };
|
||||
# in
|
||||
# switch."${toString cfg.colorscheme}")
|
||||
|
||||
(lib.mkIf cfg.xdg.enable {
|
||||
xdg = let
|
||||
home = config.home.homeDirectory;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue