From a121511678df8f07e5f9087ae851671dedfcdc5f Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 23 Mar 2019 21:44:05 -0700 Subject: Add themes feature --- linux.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'linux.nix') diff --git a/linux.nix b/linux.nix index 7301016..80dd949 100644 --- a/linux.nix +++ b/linux.nix @@ -2,6 +2,17 @@ let solarized-xresources = ./xresources; + theme = builtins.getEnv "XTHEME"; + colors = { + "dark" = { + background = "#292b2e"; + foreground = "#b2b2b2"; + }; + "light" = { + background = "#fbf8ef"; + foreground = "#655370"; + }; + }; in { imports = [ ./common.nix ./email.nix ]; @@ -16,7 +27,7 @@ in "XTerm*metaSendsEscape" = true; "XTerm*utf8" = true; }; - extraConfig = builtins.readFile(solarized-xresources + "/Xresources.light"); + extraConfig = builtins.readFile(solarized-xresources + "/Xresources." + theme); }; services = { @@ -33,13 +44,13 @@ in width = "100%"; height = "2%"; radius = 0; - background = "#fdf6e3"; # solarized base3 - foreground = "#657b83"; # solarized base00 + background = colors."${theme}".background; + foreground = colors."${theme}".foreground; tray-position = "right"; tray-detached = false; tray-maxsize = 16; tray-transparent = false; - tray-background = "#fdf6e3"; + tray-background = colors."${theme}".background; tray-offset-x = 0; tray-offset-y = 0; tray-padding = 0; -- cgit v1.2.3