From 7b9579d8559accb1f8e03b336de5edec9e78adbf Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 23 Apr 2018 20:38:31 +0200 Subject: Add basic oomox-gtk-theme derivation For my current laptop configuration I maintain a custom GTK theme to match i3 and vim color schemes (see KnairdA/dotfiles). As starting point I want to port this setup to NixOS and XMonad. The objective is to get to a point where I can change accent colors in a central location (i.e. some Nix file) and generate everything else automatically. The included derivation builds and installs this custom oomox generated theme in a quick and dirty fashion. This can definitely be improved in many ways, e.g. splitting the config into Nix params. The result looks mostly correct - remaining differences are probably due to the missing Icon theme. Additionally I had to define $HOME as oomox seems to attempt to write there in spite of the target directory definition. Note that this derivation currently only builds on unstable as older versions of sassc terminate with some kind of CSS error. Luckily this is no problem for Nix. --- conf/xmonad/xmonad.hs | 4 ++-- home.nix | 14 +++++++++++++ pkgs/oomox-gtk-theme.nix | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 pkgs/oomox-gtk-theme.nix diff --git a/conf/xmonad/xmonad.hs b/conf/xmonad/xmonad.hs index 32f4813..16d0470 100644 --- a/conf/xmonad/xmonad.hs +++ b/conf/xmonad/xmonad.hs @@ -15,10 +15,10 @@ customTabTheme = (theme xmonadTheme) { fontName = "xft:Iosevka Medium-12" , decoHeight = 20 , activeTextColor = "#222222" - , activeColor = "#aadb0f" + , activeColor = "#909737" , inactiveTextColor = "#999999" , inactiveColor = "#161616" - , activeBorderColor = "#aadb0f" + , activeBorderColor = "#909737" , inactiveBorderColor = "#161616" } availableLayouts = smartBorders $ tabs ||| tilesLM ||| tilesRM ||| tilesTM ||| tilesBM diff --git a/home.nix b/home.nix index 8325fa7..afcbc15 100644 --- a/home.nix +++ b/home.nix @@ -74,6 +74,20 @@ xresources.extraConfig = builtins.readFile ./conf/urxvt.Xresources; + gtk = { + enable = true; + + theme = { + name = "oomox"; + package = import ./pkgs/oomox-gtk-theme.nix; + }; + + gtk2.extraConfig = '' + style "vimfix" { bg[NORMAL] = "#161616" } + widget "vim-main-window.*GtkForm" style "vimfix" + ''; + }; + programs.rofi = { enable = true; location = "top"; diff --git a/pkgs/oomox-gtk-theme.nix b/pkgs/oomox-gtk-theme.nix new file mode 100644 index 0000000..73d466c --- /dev/null +++ b/pkgs/oomox-gtk-theme.nix @@ -0,0 +1,54 @@ +with import {}; + +stdenv.mkDerivation rec { + name = "oomox-gtk-theme"; + + src = fetchFromGitHub { + repo = "oomox-gtk-theme"; + owner = "themix-project"; + rev = "aa9081b2899d7e8ba8ae47543173d2d9f0f13921"; + sha256 = "1q4nksnkhdpfpgcbfqbmnkjrmwxa6zv3wy43zlas2agssjkcm4x9"; + }; + + nativeBuildInputs = [ sass sassc librsvg glib libxml2 gdk_pixbuf bc ]; + propagatedUserEnvPkgs = [ gtk-engine-murrine ]; + + config = '' + ACCENT_BG=aadb0f + BG=d8d8d8 + FG=101010 + BTN_BG=f5f5f5 + BTN_FG=111111 + CARET1_FG=101010 + CARET2_FG=101010 + CARET_SIZE=0.04 + GRADIENT=0.0 + GTK3_GENERATE_DARK=False + HDR_BTN_BG=161616 + HDR_BTN_FG=aadb0f + MATERIA_STYLE_COMPACT=True + MENU_BG=909737 + MENU_FG=1a1a1a + SEL_BG=aadb0f + SEL_FG=101010 + TXT_BG=ffffff + TXT_FG=101010 + WM_BORDER_FOCUS=909737 + WM_BORDER_UNFOCUS=909737 + ROUNDNESS=0 + SPACING=1 + ''; + + installPhase = '' + cd oomox-gtk-theme-bb6169b10b12e8e9672ba828fa503d885b5041d5 + HOME="$out/share/themes/oomox" + ./change_color.sh -m all --target-dir "$out/share/themes" --output oomox <(echo -e "${config}") + ''; + + meta = { + description = "oomox-gtk-theme is a customizable fork of Numix-gtk-theme."; + homepage = https://github.com/themix-project/oomox-gtk-theme; + license = stdenv.lib.licenses.gpl3; + platforms = stdenv.lib.platforms.all; + }; +} -- cgit v1.2.3