about summary refs log tree commit diff
path: root/common-workstation.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-10-17 06:55:39 +0200
committeraszlig <aszlig@redmoonstudios.org>2014-10-17 06:56:05 +0200
commit0dfd318c01bfe851e2255d9c77cfe9043e182b9b (patch)
treefd24bff231b725dfc02667662433f88d48211da8 /common-workstation.nix
parentb3762feaebf43454fdc35f0822345f4e9fe2d6e5 (diff)
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 <aszlig@redmoonstudios.org>
Diffstat (limited to 'common-workstation.nix')
-rw-r--r--common-workstation.nix33
1 files changed, 30 insertions, 3 deletions
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 <<EOF
+          session_x      ${toString centerLeft}%
+          msg_color      #ffffff
+          username_color #ffffff
+          password_color #ffffff
+          input_color    #ffffff
+          EOF
+        '';
+        installPhase = ''
+          cp -R share/slim/themes/nixos-slim-testing "$out"
+        '';
+      };
     };
   };