From 0dfd318c01bfe851e2255d9c77cfe9043e182b9b Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 17 Oct 2014 06:55:39 +0200 Subject: common-workstation: Remove eye cancer from theme. Or better: Remove brightness. I haven't done quite a lot to do make it really nice and shiny. Right now it only sets a darker background color and color-inverts the panel image which has the negative side-effect that the NixOS logo is yellow now, but well... it's just for the login ;-) Also, this now correctly centers the login on the leftmost screen instead of centering it across all screens. Signed-off-by: aszlig --- common-workstation.nix | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'common-workstation.nix') diff --git a/common-workstation.nix b/common-workstation.nix index 08317491..3fcff9d6 100644 --- a/common-workstation.nix +++ b/common-workstation.nix @@ -1,6 +1,8 @@ { pkgs, config, lib, ... }: -{ +let + randrHeads = config.services.xserver.xrandrHeads; +in { imports = [ ./common.nix ./packages.nix @@ -17,7 +19,6 @@ value = "--output '${name}' --preferred" + optionalString (acc != []) " --right-of '${(head acc).name}'"; }; - randrHeads = config.services.xserver.xrandrHeads; randrConf = map (getAttr "value") (foldl mkRandrConf [] randrHeads); in singleton (pkgs.writeScriptBin "xreset" '' #!${pkgs.stdenv.shell} @@ -109,7 +110,33 @@ desktopManager.xterm.enable = false; displayManager.slim.enable = true; displayManager.slim.defaultUser = "aszlig"; - displayManager.slim.theme = pkgs.slimThemes.nixosSlim; + displayManager.slim.theme = pkgs.stdenv.mkDerivation { + name = "nixos-theme-vuizvui"; + src = pkgs.slimThemes.nixosSlim; + phases = [ "unpackPhase" "patchPhase" "installPhase" ]; + patchPhase = let + centerLeft = 100 / (lib.length randrHeads * 2); + in '' + ${pkgs.imagemagick}/bin/mogrify \ + -fill '#080010' -draw 'color 0,0 reset' \ + share/slim/themes/nixos-slim-testing/background.png + ${pkgs.imagemagick}/bin/mogrify -negate \ + share/slim/themes/nixos-slim-testing/panel.png + sed -i \ + -e 's/^\([a-z_]\+_x[^0-9]*\)[0-9]\+%/\1${toString centerLeft}%/' \ + share/slim/themes/nixos-slim-testing/slim.theme + cat >> share/slim/themes/nixos-slim-testing/slim.theme <