69 lines
1.9 KiB
Nix
Executable File
69 lines
1.9 KiB
Nix
Executable File
{ pkgs, config }:
|
|
|
|
let
|
|
rendersvg = pkgs.runCommand "rendersvg" { } ''
|
|
mkdir -p $out/bin
|
|
ln -s ${pkgs.resvg}/bin/resvg $out/bin/rendersvg
|
|
'';
|
|
scheme = config.colorScheme;
|
|
in
|
|
pkgs.stdenv.mkDerivation rec {
|
|
name = "generated-gtk-theme-${scheme.slug}";
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "nana-4";
|
|
repo = "materia-theme";
|
|
rev = "6e5850388a25f424b8193fe4523504d1dc364175";
|
|
sha256 = "sha256-I6hpH0VTmftU4+/pRbztuTQcBKcOFBFbNZXJL/2bcgU=";
|
|
};
|
|
buildInputs = with pkgs; [
|
|
sassc
|
|
bc
|
|
which
|
|
rendersvg
|
|
meson
|
|
ninja
|
|
nodePackages.sass
|
|
gtk4.dev
|
|
optipng
|
|
];
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
installPhase = ''
|
|
HOME=/build
|
|
chmod 777 -R .
|
|
patchShebangs .
|
|
mkdir -p $out/share/themes
|
|
mkdir bin
|
|
sed -e 's/handle-horz-.*//' -e 's/handle-vert-.*//' -i ./src/gtk-2.0/assets.txt
|
|
|
|
cat > /build/gtk-colors << EOF
|
|
BG=${scheme.colors.base00}
|
|
FG=${scheme.colors.base07}
|
|
HDR_BG=${scheme.colors.base00}
|
|
HDR_FG=${scheme.colors.base07}
|
|
SEL_BG=${scheme.colors.base03}
|
|
SEL_FG=${scheme.colors.base07}
|
|
TXT_BG=${scheme.colors.base01}
|
|
TXT_FG=${scheme.colors.base07}
|
|
BTN_BG=${scheme.colors.base01}
|
|
BTN_FG=${scheme.colors.base07}
|
|
HDR_BTN_BG=${scheme.colors.base01}
|
|
HDR_BTN_FG=${scheme.colors.base07}
|
|
MENU_BG=${scheme.colors.base00}
|
|
MENU_FG=${scheme.colors.base07}
|
|
ACCENT_BG=${scheme.colors.base0C}
|
|
ACCENT_FG=${scheme.colors.base00}
|
|
MATERIA_SURFACE=${scheme.colors.base01}
|
|
MATERIA_VIEW=${scheme.colors.base00}
|
|
WM_BORDER_FOCUS=${scheme.colors.base02}
|
|
WM_BORDER_UNFOCUS=${scheme.colors.base02}
|
|
UNITY_DEFAULT_LAUNCHER_STYLE=False
|
|
ROUNDNESS=7
|
|
NAME=${scheme.slug}
|
|
MATERIA_STYLE_COMPACT=True
|
|
EOF
|
|
|
|
echo "Changing colours:"
|
|
./change_color.sh -o ${scheme.slug} /build/gtk-colors -i False -t "$out/share/themes"
|
|
chmod 555 -R .
|
|
'';
|
|
} |