103 lines
3.1 KiB
Nix
Raw Normal View History

2020-08-04 01:46:48 +04:00
{ pkgs, config, lib, inputs, ... }:
2019-09-11 17:17:56 +04:00
let
2020-08-10 01:17:22 +04:00
thm = config.lib.base16.theme;
2019-09-11 17:17:56 +04:00
materia_colors = pkgs.writeTextFile {
name = "gtk-generated-colors";
2021-02-17 01:06:42 +03:00
# https://github.com/themix-project/themix-plugin-base16/blob/453cccbd2e22f69078c6ded894421c4c0f943bc0/oomox_plugin.py#L424
# text = ''
# BG=${thm.base00-hex}
# FG=${thm.base07-hex}
# BTN_BG=${thm.base00-hex}
# BTN_FG=${thm.base07-hex}
# MENU_BG=${thm.base00-hex}
# MENU_FG=${thm.base07-hex}
# ACCENT_BG=${thm.base02-hex}
# SEL_BG=${thm.base0D-hex}
# SEL_FG=${thm.base00-hex}
# TXT_BG=${thm.base00-hex}
# TXT_FG=${thm.base07-hex}
# HDR_BTN_BG=${thm.base00-hex}
# HDR_BTN_FG=${thm.base07-hex}
# WM_BORDER_FOCUS=${thm.base02-hex}
# WM_BORDER_UNFOCUS=${thm.base01-hex}
# MATERIA_STYLE_COMPACT=True
# MATERIA_COLOR_VARIANT=dark
# UNITY_DEFAULT_LAUNCHER_STYLE=False
# NAME=generated
# '';
2019-09-11 17:17:56 +04:00
text = ''
2021-02-17 01:06:42 +03:00
BG=${thm.base01-hex}
FG=${thm.base06-hex}
HDR_BG=${thm.base00-hex}
HDR_FG=${thm.base05-hex}
SEL_BG=${thm.base0E-hex}
SEL_FG=${thm.base00-hex}
ACCENT_BG=${thm.base0E-hex}
TXT_BG=${thm.base02-hex}
TXT_FG=${thm.base07-hex}
2020-08-10 01:17:22 +04:00
BTN_BG=${thm.base00-hex}
BTN_FG=${thm.base05-hex}
2021-02-17 01:06:42 +03:00
HDR_BTN_BG=${thm.base01-hex}
2020-08-10 01:17:22 +04:00
HDR_BTN_FG=${thm.base05-hex}
2021-02-17 01:06:42 +03:00
ICONS_LIGHT_FOLDER=${thm.base0D-hex}
ICONS_LIGHT=${thm.base0D-hex}
ICONS_MEDIUM=${thm.base0E-hex}
ICONS_DARK=${thm.base00-hex}
2019-09-11 17:17:56 +04:00
MATERIA_STYLE_COMPACT=True
MATERIA_COLOR_VARIANT=dark
UNITY_DEFAULT_LAUNCHER_STYLE=False
NAME=generated
'';
};
in {
2021-02-07 02:38:11 +03:00
nixpkgs.overlays = [
(self: super: {
generated-gtk-theme = self.stdenv.mkDerivation rec {
name = "generated-gtk-theme";
src = inputs.materia-theme;
buildInputs = with self; [ sassc bc which inkscape optipng ];
installPhase = ''
HOME=/build
chmod 777 -R .
patchShebangs .
mkdir -p $out/share/themes
substituteInPlace change_color.sh --replace "\$HOME/.themes" "$out/share/themes"
echo "Changing colours:"
./change_color.sh -o Generated ${materia_colors}
chmod 555 -R .
'';
};
})
];
programs.dconf.enable = true;
2020-08-07 23:27:49 +04:00
services.dbus.packages = with pkgs; [ gnome3.dconf ];
2019-09-11 17:17:56 +04:00
home-manager.users.alukard = {
gtk = {
enable = true;
iconTheme = {
2021-02-07 02:38:11 +03:00
name = "${thm.iconTheme}";
2019-09-11 17:17:56 +04:00
package = pkgs.papirus-icon-theme;
};
theme = {
name = "Generated";
package = pkgs.generated-gtk-theme;
};
2019-09-22 13:35:49 +04:00
font = {
2020-08-15 19:36:16 +04:00
name = "${thm.font} ${thm.normalFontSize}";
2019-09-22 13:35:49 +04:00
};
2021-02-07 02:38:11 +03:00
gtk3 = {
extraConfig = {
gtk-cursor-theme-name = "Bibata-Modern-Classic";
};
};
2019-09-11 17:17:56 +04:00
};
2021-02-07 02:38:11 +03:00
2020-08-07 23:27:49 +04:00
home.sessionVariables.GTK_THEME = "Generated";
2020-11-10 00:09:40 +04:00
home.sessionVariables.XDG_DATA_DIRS = [
"${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}"
"${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}"
];
2019-09-11 17:17:56 +04:00
};
2021-02-07 02:38:11 +03:00
environment.sessionVariables.XDG_CURRENT_DESKTOP = "X-Generic";
2019-09-11 17:17:56 +04:00
}