summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--default.nix55
-rw-r--r--lass/2configs/newsbot-js.nix1
-rw-r--r--tv/1systems/wu.nix10
-rw-r--r--tv/2configs/base.nix7
-rw-r--r--tv/2configs/synaptics.nix14
-rw-r--r--tv/2configs/urlwatch.nix4
-rw-r--r--tv/2configs/xserver.nix41
-rw-r--r--tv/2configs/xserver/Xresources.nix215
-rw-r--r--tv/2configs/xserver/default.nix126
-rw-r--r--tv/2configs/xserver/xmonad/Main.hs277
-rw-r--r--tv/2configs/xserver/xmonad/Util/Debunk.hs16
-rw-r--r--tv/2configs/xserver/xmonad/Util/Font.hs123
-rw-r--r--tv/2configs/xserver/xmonad/Util/Pager.hs172
-rw-r--r--tv/2configs/xserver/xmonad/Util/Rhombus.hs370
-rw-r--r--tv/2configs/xserver/xmonad/Util/Submap.hs31
-rw-r--r--tv/2configs/xserver/xmonad/Util/XUtils.hs47
-rw-r--r--tv/2configs/xserver/xmonad/xmonad.cabal18
-rw-r--r--tv/2configs/xserver/xserver.conf.nix40
-rw-r--r--tv/5pkgs/default.nix7
-rw-r--r--tv/5pkgs/ff/default.nix8
20 files changed, 1455 insertions, 127 deletions
diff --git a/default.nix b/default.nix
index b261e51e7..c78464198 100644
--- a/default.nix
+++ b/default.nix
@@ -1,19 +1,3 @@
-# Welcome to the top-level default.nix of stockholm.
-#
-# You can discover the whole thing easily using the `get` utility,
-# which can be found at http://cgit.cd.krebsco.de/get/tree/get
-# To install `get` on any Nix-enabled system, use:
-#
-# nix-env -f /path/to/stockholm -iA pkgs.get
-#
-# The "current" arguments are used to provide information about the user who's
-# evaluating this file. This information is used to determine which user
-# namespace is to be used. Of course there's nothing trying to prevent you
-# from forging this information. E.g. you could try to generate the deployment
-# script for some random user's system, targeting some random host:
-#
-# LOGNAME=tv get krebs.deploy system=nomic target=8.8.8.8
-#
{ current-date ? abort "current-date not defined"
, current-host-name ? abort "current-host-name not defined"
, current-user-name ? builtins.getEnv "LOGNAME"
@@ -21,29 +5,8 @@
}@args:
let stockholm = {
- # The generated scripts to deploy (or infest) systems can be found in the
- # `krebs` attribute. There's also an init script, but it's in its early
- # stages, not well integrated and mostly useless at the moment. :)
- #
- # You'll also find lib here, which is nixpkgs/lib + krebs lib, but nobody
- # is really accessing this directly, as this lib gets reexported below.
inherit krebs;
-
- # All systems of all users can be found here.
- #
- # /!\ Please note that `get users.${user-name}.${host-name}.system` is a
- # bad idea because it will produce vast amounts of output. These are the
- # actual and complete system derivations that can be installed on the
- # respective host.
- #
- # Another thing to notice here is that other user's systems might not be
- # evaluable because of missing secrets. If you _are_ able to evaluate
- # another user's system, then you probably share a similar naming scheme
- # for your secret files! :)
inherit users;
-
- # Additionally, output lib and pkgs for easy access from the shell.
- # Notice how we're evaluating just the base module to obtain pkgs.
inherit lib;
inherit pkgs;
};
@@ -65,32 +28,20 @@ let stockholm = {
inherit (eval {}) pkgs;
- # Path resolvers for common and individual files.
- # Example: `upath "3modules"` produces the current user's 3modules directory
kpath = lib.nspath "krebs";
upath = lib.nspath current-user-name;
- # This is the base module. Its purpose is to provide modules and
- # packages, both common ones, found in krebs/ as well as the current user's,
- # found in the user's namespace.
base-module = {
imports = map (f: f "3modules") [ kpath upath ];
nixpkgs.config.packageOverrides = pkgs:
let
- # Notice the ordering. Krebs packages can only depend on Nixpkgs,
- # whereas user packages additionally can depend on krebs packages.
kpkgs = import (kpath "5pkgs") { inherit lib pkgs; };
upkgs = import (upath "5pkgs") { inherit lib; pkgs = pkgs // kpkgs; };
in
kpkgs // upkgs;
};
- # The above base module is used together with a NixOS configuration to
- # produce a system. Notice how stockholm really just provides additional
- # packages and modules on top of NixOS. Some of this stuff might become
- # useful to a broader audience, at which point it should probably be merged
- # and pull-requested for inclusion into NixOS/nixpkgs.
eval = config: import <nixpkgs/nixos/lib/eval-config.nix> {
specialArgs = {
inherit lib;
@@ -101,10 +52,6 @@ let stockholm = {
];
};
- # Any top-level directory other than krebs/ is considered to be a user
- # namespace, configuring a bunch of systems.
- # Have a look at the definition of install in krebs/default.nix to see how
- # nix-env is using this attribute set to obtain the system to be installed.
# TODO move user namespaces' to users/, so no exception for krebs/ is needed
users =
lib.mapAttrs
@@ -113,8 +60,6 @@ let stockholm = {
(n: t: !lib.hasPrefix "." n && t == "directory" && n != "krebs")
(builtins.readDir ./.));
- # Given a path to a user namespace, provide an attribute of evaluated
- # system configurations, keyed by system names (AKA host names).
eval-all-systems = path:
lib.mapAttrs'
(n: _: (lib.nameValuePair (lib.removeSuffix ".nix" n)
diff --git a/lass/2configs/newsbot-js.nix b/lass/2configs/newsbot-js.nix
index 211b29780..74d09b7fa 100644
--- a/lass/2configs/newsbot-js.nix
+++ b/lass/2configs/newsbot-js.nix
@@ -21,6 +21,7 @@ let
bdt_pressemitteilungen|http://bundestag.de/service/rss/Bundestag_Presse.rss|#news #bundestag
bdt_wd|http://bundestag.de/service/rss/Bundestag_WD.rss|#news #bundestag
bitcoinpakistan|https://bitcoinspakistan.com/feed/|#news #financial
+ c|http://www.tempolimit-lichtgeschwindigkeit.de/news.xml|#news
cancer|http://feeds.feedburner.com/ncinewsreleases?format=xml|#news
carta|http://feeds2.feedburner.com/carta-standard-rss|#news
catholic_news|http://feeds.feedburner.com/catholicnewsagency/dailynews|#news
diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix
index 89ad257f0..a5232c9e1 100644
--- a/tv/1systems/wu.nix
+++ b/tv/1systems/wu.nix
@@ -29,8 +29,7 @@ with lib;
#../2configs/consul-client.nix
../2configs/git.nix
../2configs/mail-client.nix
- ../2configs/xserver.nix
- ../2configs/synaptics.nix # TODO w110er if xserver is enabled
+ ../2configs/xserver
../2configs/test.nix
{
environment.systemPackages = with pkgs; [
@@ -41,12 +40,6 @@ with lib;
hashPassword
lentil
parallel
- (pkgs.writeScriptBin "ff" ''
- #! ${pkgs.bash}/bin/bash
- exec sudo -u ff -i <<EOF
- exec ${pkgs.firefoxWrapper}/bin/firefox $(printf " %q" "$@")
- EOF
- '')
(pkgs.writeScriptBin "im" ''
#! ${pkgs.bash}/bin/bash
export PATH=${makeSearchPath "bin" (with pkgs; [
@@ -70,6 +63,7 @@ with lib;
bind # dig
cac
dic
+ ff
file
get
gitAndTools.qgit
diff --git a/tv/2configs/base.nix b/tv/2configs/base.nix
index 4de980cf1..0a8dbdcc2 100644
--- a/tv/2configs/base.nix
+++ b/tv/2configs/base.nix
@@ -153,10 +153,9 @@ in
}
{
- nixpkgs.config.packageOverrides = pkgs:
- {
- nano = pkgs.runCommand "empty" {} "mkdir -p $out";
- };
+ nixpkgs.config.packageOverrides = pkgs: {
+ nano = pkgs.vim;
+ };
services.cron.enable = false;
services.nscd.enable = false;
diff --git a/tv/2configs/synaptics.nix b/tv/2configs/synaptics.nix
deleted file mode 100644
index c47cb9deb..000000000
--- a/tv/2configs/synaptics.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ config, pkgs, ... }:
-
-{
- # TODO this is host specific
- services.xserver.synaptics = {
- enable = true;
- twoFingerScroll = true;
- accelFactor = "0.035";
- additionalOptions = ''
- Option "FingerHigh" "60"
- Option "FingerLow" "60"
- '';
- };
-}
diff --git a/tv/2configs/urlwatch.nix b/tv/2configs/urlwatch.nix
index 373803cc6..8189f6345 100644
--- a/tv/2configs/urlwatch.nix
+++ b/tv/2configs/urlwatch.nix
@@ -47,6 +47,10 @@
# ref <stockholm/krebs/3modules>, services.openssh.knownHosts.github*
https://help.github.com/articles/what-ip-addresses-does-github-use-that-i-should-whitelist/
+
+ # <stockholm/tv/2configs/xserver/xserver.conf.nix>
+ # is derived from `configFile` in:
+ https://raw.githubusercontent.com/NixOS/nixpkgs/master/nixos/modules/services/x11/xserver.nix
];
};
}
diff --git a/tv/2configs/xserver.nix b/tv/2configs/xserver.nix
deleted file mode 100644
index 7fc07f927..000000000
--- a/tv/2configs/xserver.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ config, pkgs, ... }:
-
-{
- imports = [
- ../2configs/urxvt.nix # TODO via xserver
- ];
-
- services.xserver.enable = true;
-
-
- #fonts.enableFontConfig = true;
- #fonts.enableFontDir = true;
- fonts.fonts = [
- pkgs.xlibs.fontschumachermisc
- ];
- #services.xfs.enable = true;
- #services.xserver.useXFS = "unix/:7100";
-
- services.xserver.displayManager.desktopManagerHandlesLidAndPower = true;
-
- #services.xserver.display = 11;
- #services.xserver.tty = 11;
- # services.xserver.layout = "us";
- # services.xserver.xkbOptions = "eurosign:e";
-
- #services.xserver.multitouch.enable = true;
-
- services.xserver.windowManager.xmonad.extraPackages = hspkgs: with hspkgs; [
- X11-xshape
- ];
- services.xserver.windowManager.xmonad.enable = true;
- services.xserver.windowManager.xmonad.enableContribAndExtras = true;
- services.xserver.windowManager.default = "xmonad";
- services.xserver.desktopManager.default = "none";
- services.xserver.desktopManager.xterm.enable = false;
-
- services.xserver.displayManager.slim.enable = true;
- #services.xserver.displayManager.auto.enable = true;
- #services.xserver.displayManager.auto.user = "tv";
- #services.xserver.displayManager.job.logsXsession = true;
-}
diff --git a/tv/2configs/xserver/Xresources.nix b/tv/2configs/xserver/Xresources.nix
new file mode 100644
index 000000000..f287bf206
--- /dev/null
+++ b/tv/2configs/xserver/Xresources.nix
@@ -0,0 +1,215 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+pkgs.writeText "Xresources" ''
+ !URxvt*background: #050505
+
+ ! 2013-02-25 \e was reas escape before
+ ! *VT100.Translations: #override\
+ ! :<Btn4Down>: string("\e[5~")\n\
+ ! :<Btn5Down>: string("\e[6~")
+
+ ! XTerm*VT100*Translations: #override \
+ ! Shift<Key>Return: string(" &") string(0x0A) \n\
+ ! Meta<Key>Return: string(" | less") string(0x0A) \n\
+ ! ~Shift<Key>Prior: scroll-back(1,page) \n\
+ ! ~Shift<Key>Next: scroll-forw(1,page) \n\
+ ! Shift<Key>Prior: scroll-back(1) \n\
+ ! Shift<Key>Next: scroll-forw(1) \n\
+ ! <Key>Delete: string(0x1b) string("[2~")
+ ! \n\
+ ! <Key>BackSpace: string(0x7f)
+
+ ! 2013-02-2013-02-25
+ ! ! <M-c>: load bash-completion (if not already)
+ ! URxvt*VT100*Translations: #override\
+ ! Meta<KeyPress>c:\
+ ! string("\eOH# \eOF\n+compl\n\eOA\eOA\eOH\e[3~\e[3~\eOF")\
+ ! string(0x7)\n
+
+ ! do not scroll automatically on output:
+ ! XTerm*scrollTtyOutput: false
+ URxvt*cutchars: "\\`\"'&()*,;<=>?@[]^{|}‘’"
+ ! URxvt*secondaryScreen: false
+
+ ! URxvt*loginShell: true
+
+ URxvt*eightBitInput: false
+ ! *eightBitOutput: 1
+ ! URxvt*decTerminalID: 220
+ ! URxvt*utf8: 1
+ ! URxvt*locale: UTF-8
+ ! XTerm*customization: -color
+ URxvt*SaveLines: 4096
+ URxvt*font: -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1
+ URxvt*boldFont: -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1
+
+ ! 2013-05-23 if this does not work try
+ ! xset +fp /usr/share/fonts/local/
+ ! xset fp rehash
+ ! URxvt*font: -*-termsynu-edium-*-*-*-12-*-*-*-*-*-iso10646-1
+ ! URxvt*boldFont: -*-termsynu-bold-*-*-*-12-*-*-*-*-*-iso10646-1
+ !
+ !-misc-termsynu-medium-r-normal--12-87-100-100-c-70-iso10646-1
+
+ ! XTerm*font: -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1
+ URxvt*scrollBar: false
+
+ ! XTerm*font:-nil-profont-medium-r-normal--11-110-72-72-c-60-iso8859-1
+ ! URxvt*boldFont:-nil-profont-medium-r-normal--11-110-72-72-c-60-iso8859-1
+
+ URxvt*background: #050505
+ ! URxvt*background: #041204
+
+ !URxvt.depth: 32
+ !URxvt*background: rgba:0500/0500/0500/cccc
+
+ ! URxvt*background: #080810
+ URxvt*foreground: #d0d7d0
+ ! URxvt*background: black
+ ! URxvt*foreground: white
+ ! URxvt*background: rgb:00/00/40
+ ! URxvt*foreground: rgb:a0/a0/d0
+ ! XTerm*cursorColor: rgb:00/00/60
+ URxvt*cursorColor: #f042b0
+ URxvt*cursorColor2: #f0b000
+ URxvt*cursorBlink: off
+ ! URxvt*cursorUnderline: true
+ ! URxvt*highlightColor: #232323
+ ! URxvt*highlightTextColor: #b0ffb0
+
+ URxvt*.pointerBlank: true
+ URxvt*.pointerBlankDelay: 987654321
+ URxvt*.pointerColor: #f042b0
+ URxvt*.pointerColor2: #050505
+
+ ! URxvt*fading: 50
+ ! URxvt*fadeColor: #0f0f0f
+
+ ! XTerm*colorMode: on
+ ! URxvt*dynamicColors: on
+ ! URxvt*boldColors: off
+
+ URxvt*jumpScroll: true
+
+ ! allow synthetic events for fvwm, so pass window specific keys
+ ! XTerm*allowSendEvents: true
+ URxvt*allowSendEvents: false
+
+ ! better double/tripple clicking in xterms
+ ! Format: csv, [low-]high:value
+ !
+ ! extend character class 48 due they are used in urls
+ ! (see: man xterm; /CHARACTER CLASSES)
+ ! ! % -./ @ & = ?
+ URxvt*charClass: 33:48,37:48,45-47:48,64:48,38:48,61:48,63:48
+ URxvt*cutNewline: False
+ URxvt*cutToBeginningOfLine: False
+
+ ! BLACK for indigo background
+ URxvt*color0: #232342
+
+ ! TODO: man xterm; /ACTIONS
+
+ ! *VT100*colorULMode: on
+ ! XTerm*underLine: on
+ !
+ ! URxvt*color0: black
+ ! URxvt*color1: red3
+ ! URxvt*color2: green3
+ ! URxvt*color3: yellow3
+ ! URxvt*color4: blue2
+ ! URxvt*color5: magenta3
+ ! URxvt*color6: cyan3
+ ! URxvt*color7: gray90
+ ! URxvt*color8: burlywood1
+ ! URxvt*color9: sienna1
+ ! URxvt*color10: PaleVioletRed1
+ ! URxvt*color11: LightSkyBlue
+ ! URxvt*color12: white
+ ! URxvt*color13: white
+ ! URxvt*color14: white
+ ! URxvt*color33: #f0b0f0
+
+
+ ! URxvt*color0: #000000
+ ! URxvt*color1: #c00000
+ ! URxvt*color2: #80c070
+ URxvt*color3: #c07000
+ ! URxvt*color4: #0000c0
+ URxvt*color4: #4040c0
+ ! URxvt*color5: #c000c0
+ ! URxvt*color6: #008080
+ URxvt*color7: #c0c0c0
+
+ URxvt*color8: #707070
+ URxvt*color9: #ff6060
+ URxvt*color10: #70ff70
+ URxvt*color11: #ffff70
+ URxvt*color12: #7070ff
+ URxvt*color13: #ff50ff
+ URxvt*color14: #70ffff
+ URxvt*color15: #ffffff
+
+ ! XTerm*color91: #000070
+ ! XTerm*color92: #000080
+ ! XTerm*color93: #000090
+ ! XTerm*color94: #0000a0
+ ! XTerm*color95: #0000b0
+ ! XTerm*color96: #0000c0
+ ! XTerm*color97: #0000d0
+ ! XTerm*color98: #0000e0
+ ! XTerm*color99: #0000f0
+
+ ! !! vim-create-colorscheme {{{
+ ! !! Question cterm=none
+ ! XTerm*color20: #f0b000
+ ! !! }}}
+ !
+ !
+ ! #include ".xrdb/look-zenburn.xrdb"
+ ! #include ".xrdb/xterm.xrdb"
+
+
+
+ ! URxvt.perl-ext: matcher
+ ! URxvt.urlLauncher: cr
+ ! URxvt.underlineColor: blue
+
+ ! URxvt.matcher.button: 1
+ ! URxvt.perl-ext: default,matcher
+ ! URxvt.urlLauncher: cr
+ ! URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-]
+ ! URxvt.underlineColor: blue
+
+ ! 2014-05-12 von lass
+ !URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select
+ !URxvt.url-select.launcher: /home/tv/bin/ff -new-tab
+ !URxvt.url-select.underline: true
+ !URxvt.keysym.M-u: perl:url-select:select_next
+ !URxvt.keysym.M-Escape: perl:keyboard-select:activate
+ !URxvt.keysym.M-s: perl:keyboard-select:search
+
+
+
+
+ ! 2013-02-25 I neve use this
+ URxvt*iso14755: False
+
+ URxvt*urgentOnBell: True
+ URxvt*visualBell: True
+
+ ! ref https://github.com/muennich/urxvt-perls
+ URxvt*perl-ext: default,url-select
+ URxvt*keysym.M-u: perl:url-select:select_next
+ URxvt*url-select.launcher: ${pkgs.ff}/bin/ff -new-tab
+ URxvt*url-select.underline: true
+ URxvt*colorUL: #4682B4
+ URxvt.perl-lib: ${pkgs.urxvt_perls}/lib/urxvt/perl
+
+ root-urxvt*background: #230000
+ root-urxvt*foreground: #e0c0c0
+ root-urxvt*BorderColor: #400000
+ root-urxvt*color0: #800000
+''
diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix
new file mode 100644
index 000000000..5d3372609
--- /dev/null
+++ b/tv/2configs/xserver/default.nix
@@ -0,0 +1,126 @@
+{ config, lib, pkgs, ... }@args:
+
+with lib;
+
+let
+ # TODO krebs.build.user
+ user = config.users.users.tv;
+
+ out = {
+ services.xserver.display = 11;
+ services.xserver.tty = 11;
+
+ services.xserver.synaptics = {
+ enable = true;
+ twoFingerScroll = true;
+ accelFactor = "0.035";
+ };
+
+ fonts.fonts = [
+ pkgs.xlibs.fontschumachermisc
+ ];
+
+ systemd.services.urxvtd = {
+ wantedBy = [ "multi-user.target" ];
+ reloadIfChanged = true;
+ serviceConfig = {
+ ExecReload = need-reload "urxvtd.service";
+ ExecStart = "${pkgs.rxvt_unicode}/bin/urxvtd";
+ Restart = "always";
+ RestartSec = "2s";
+ StartLimitBurst = 0;
+ User = user.name;
+ };
+ };
+
+ environment.systemPackages = [
+ pkgs.slock
+ ];
+
+ security.setuidPrograms = [
+ "slock"
+ ];
+
+ systemd.services.display-manager = mkForce {};
+
+ services.xserver.enable = true;
+ systemd.services.xmonad = {
+ wantedBy = [ "multi-user.target" ];
+ requires = [ "xserver.service" ];
+ serviceConfig = {
+ ExecStart = "${xmonad}/bin/xmonad";
+ User = user.name;
+ WorkingDirectory = user.home;
+ };
+ };
+
+ systemd.services.xserver = {
+ after = [
+ "systemd-udev-settle.service"
+ "local-fs.target"
+ "acpid.service"
+ ];
+ reloadIfChanged = true;
+ environment = xserver-environment;
+ serviceConfig = {
+ ExecReload = need-reload "xserver.service";
+ ExecStart = "${xserver}/bin/xserver";
+ };
+ };
+ };
+
+ xmonad = let
+ pkg = pkgs.haskellPackages.callPackage src {};
+ src = pkgs.runCommand "xmonad-package" {} ''
+ ${pkgs.cabal2nix}/bin/cabal2nix ${./xmonad} > $out
+ '';
+ in pkgs.writeScriptBin "xmonad" ''
+ #! /bin/sh
+ set -efu
+ export DISPLAY; DISPLAY=:${toString config.services.xserver.display}
+ export PATH; PATH=${makeSearchPath "bin" [
+ pkgs.rxvt_unicode
+ ]}:/var/setuid-wrappers
+ settle() {(
+ # Use PATH for a clean journal
+ command=''${1##*/}
+ PATH=''${1%/*}; export PATH
+ shift
+ until "$command" "$@"; do
+ ${pkgs.coreutils}/bin/sleep 1
+ done
+ )&}
+ settle ${pkgs.xorg.xhost}/bin/xhost +LOCAL:
+ settle ${pkgs.xorg.xrdb}/bin/xrdb -merge ${import ./Xresources.nix args}
+ settle ${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c'
+ exec ${pkg}/bin/xmonad
+ '';
+
+ xserver-environment = {
+ XKB_BINDIR = "${pkgs.xorg.xkbcomp}/bin"; # Needed for the Xkb extension.
+ XORG_DRI_DRIVER_PATH = "/run/opengl-driver/lib/dri"; # !!! Depends on the driver selected at runtime.
+ LD_LIBRARY_PATH = concatStringsSep ":" (
+ [ "${pkgs.xorg.libX11}/lib" "${pkgs.xorg.libXext}/lib" ]
+ ++ concatLists (catAttrs "libPath" config.services.xserver.drivers));
+ };
+
+ xserver = pkgs.writeScriptBin "xserver" ''
+ #! /bin/sh
+ set -efu
+ exec ${pkgs.xorg.xorgserver}/bin/X \
+ :${toString config.services.xserver.display} \
+ vt${toString config.services.xserver.tty} \
+ -config ${import ./xserver.conf.nix args} \
+ -logfile /var/log/X.${toString config.services.xserver.display}.log \
+ -nolisten tcp \
+ -xkbdir ${pkgs.xkeyboard_config}/etc/X11/xkb \
+ '';
+
+ need-reload = s: let
+ pkg = pkgs.writeScriptBin "need-reload" ''
+ #! /bin/sh
+ echo "$*"
+ '';
+ in "${pkg}/bin/need-reload ${s}";
+
+in out
diff --git a/tv/2configs/xserver/xmonad/Main.hs b/tv/2configs/xserver/xmonad/Main.hs
new file mode 100644
index 000000000..cca2902a0
--- /dev/null
+++ b/tv/2configs/xserver/xmonad/Main.hs
@@ -0,0 +1,277 @@
+{-# LANGUAGE DeriveDataTypeable #-} -- for XS
+
+
+module Main where
+
+import XMonad
+import XMonad.Prompt (defaultXPConfig)
+import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace
+ , removeEmptyWorkspace)
+import XMonad.Actions.GridSelect
+import XMonad.Actions.CycleWS (toggleWS)
+--import XMonad.Actions.CopyWindow ( copy )
+import XMonad.Layout.NoBorders ( smartBorders )
+import qualified XMonad.StackSet as W
+import Data.Map (Map)
+import qualified Data.Map as Map
+-- TODO import XMonad.Layout.WorkspaceDir
+import XMonad.Hooks.UrgencyHook (SpawnUrgencyHook(..), withUrgencyHook)
+-- import XMonad.Layout.Tabbed
+--import XMonad.Layout.MouseResizableTile
+import XMonad.Layout.Reflect (reflectVert)
+import XMonad.Layout.FixedColumn (FixedColumn(..))
+import XMonad.Hooks.Place (placeHook, smart)
+import XMonad.Hooks.FloatNext (floatNextHook)
+import XMonad.Actions.PerWorkspaceKeys (chooseAction)
+import XMonad.Layout.PerWorkspace (onWorkspace)
+--import XMonad.Layout.BinarySpacePartition
+
+--import XMonad.Actions.Submap
+import Util.Pager
+import Util.Rhombus
+import Util.Debunk
+
+
+--data MyState = MyState deriving Typeable
+
+myTerm :: String
+myTerm = "urxvtc"
+
+myRootTerm :: String
+myRootTerm = "urxvtc -name root-urxvt -e su -"
+
+-- TODO execRootTerm = exec (shlex "urxvtc -e su -")
+-- [ ("XENVIRONMENT", HOME ++ "/.Xdefaults/root-urxvt") ]
+
+
+myFont :: String
+myFont = "-schumacher-*-*-*-*-*-*-*-*-*-*-*-iso10646-*"
+
+main :: IO ()
+main = do
+ -- TODO exec (shlex "xrdb -merge" ++ [HOME ++ "/.Xresources"])
+ -- TODO exec (shlex "xsetroot -solid '#1c1c1c'")
+ --spawn "xrdb -merge \"$HOME/.Xresources\""
+ --spawn "xsetroot -solid '#1c1c1c'"
+ xmonad
+ -- $ withUrgencyHookC dzenUrgencyHook { args = ["-bg", "magenta", "-fg", "magenta", "-h", "2"], duration = 500000 }
+ -- urgencyConfig { remindWhen = Every 1 }
+ -- $ withUrgencyHook borderUrgencyHook "magenta"
+ -- $ withUrgencyHookC BorderUrgencyHook { urgencyBorderColor = "magenta" } urgencyConfig { suppressWhen = Never }
+ $ withUrgencyHook (SpawnUrgencyHook "echo emit Urgency ")
+ $ defaultConfig
+ { terminal = myTerm
+ , modMask = mod4Mask
+ , keys = myKeys
+ , workspaces =
+ [ "Dashboard" -- we start here
+ , "23"
+ , "cr"
+ , "ff"
+ , "hack"
+ , "im"
+ , "mail"
+ , "zalora", "zjournal", "zskype"
+ ]
+ , layoutHook = smartBorders $ myLayout
+ -- , handleEventHook = myHandleEventHooks <+> handleTimerEvent
+ --, handleEventHook = handleTimerEvent
+ , manageHook = placeHook (smart (1,0)) <+> floatNextHook
+ , startupHook = spawn "echo emit XMonadStartup"
+ , normalBorderColor = "#1c1c1c"
+ , focusedBorderColor = "#f000b0"
+ }
+ where
+ myLayout =
+ (onWorkspace "im" $ reflectVert $ Mirror $ Tall 1 (3/100) (12/13))
+ (FixedColumn 1 20 80 10 ||| Full)
+
+
+spawnTermAt :: String -> X ()
+--spawnTermAt _ = floatNext True >> spawn myTerm
+--spawnTermAt "ff" = floatNext True >> spawn myTerm
+spawnTermAt _ = spawn myTerm
+
+
+
+--jojo w = withDisplay $ \d -> liftIO $ do
+-- wa <- getWindowAttributes d w
+-- printToErrors (wa_width wa, wa_height wa, wa_x wa, wa_y wa)
+
+ --sh <- getWMNormalHints d w
+ --bw <- fmap (fi . wa_border_width) $ getWindowAttributes d w
+ --return $ applySizeHints bw sh
+
+
+--data WindowDetails = WindowDetails
+-- { wd_name :: Maybe String
+-- , wd_rect :: Rectangle
+-- } deriving (Show)
+
+-- urxvtc
+-- -title sets {,_NET_}WM_NAME but not WM_CLASS and {,_NET_}WM_ICON_NAME res: title
+-- -name sets all res:
+--mySpawn cmd = do
+-- p <- xfork $ executeFile "/run/current-system/sw/bin/urxvtc" False [] Nothing
+-- liftIO $ printToErrors $ (cmd, p)
+
+
+myKeys :: XConfig Layout -> Map (KeyMask, KeySym) (X ())
+myKeys conf = Map.fromList $
+ [ ((_4C , xK_Delete ), spawn "make -C $HOME/.xmonad reload")
+ , ((_4 , xK_Escape ), spawn "/var/setuid-wrappers/slock")
+ , ((_4S , xK_c ), kill)
+
+ , ((_4 , xK_x ), chooseAction spawnTermAt)
+ , ((_4C , xK_x ), spawn myRootTerm)
+ --, ((_4M , xK_x ), spawn "xterm")
+ --, ((_4M , xK_x ), mySpawn "xterm")
+
+ --, ((_4 , xK_F1 ), withFocused jojo)
+ --, ((_4 , xK_F1 ), printAllGeometries)
+
+ , ((0 , xK_Menu ), gets windowset >>= allWorkspaceNames >>= pager pagerConfig (windows . W.view) )
+ , ((_S , xK_Menu ), gets windowset >>= allWorkspaceNames >>= pager pagerConfig (windows . W.shift) )
+ , ((_C , xK_Menu ), toggleWS)
+ , ((_4 , xK_Menu ), rhombus horseConfig (liftIO . printToErrors) ["Correct", "Horse", "Battery", "Staple", "Stuhl", "Tisch"] )
+
+ -- %! Rotate through the available layout algorithms
+ , ((_4 , xK_space ), sendMessage NextLayout)
+ , ((_4S , xK_space ), setLayout $ XMonad.layoutHook conf) -- reset layout
+
+ ---- BinarySpacePartition
+ --, ((_4 , xK_l), sendMessage $ ExpandTowards R)
+ --, ((_4 , xK_h), sendMessage $ ExpandTowards L)
+ --, ((_4 , xK_j), sendMessage $ ExpandTowards D)
+ --, ((_4 , xK_k), sendMessage $ ExpandTowards U)
+ --, ((_4S , xK_l), sendMessage $ ShrinkFrom R)
+ --, ((_4S , xK_h), sendMessage $ ShrinkFrom L)
+ --, ((_4S , xK_j), sendMessage $ ShrinkFrom D)
+ --, ((_4S , xK_k), sendMessage $ ShrinkFrom U)
+ --, ((_4 , xK_n), sendMessage Rotate)
+ --, ((_4S , xK_n), sendMessage Swap)
+
+ ---- mouseResizableTile
+ --, ((_4 , xK_u), sendMessage ShrinkSlave)
+ --, ((_4 , xK_i), sendMessage ExpandSlave)
+
+ -- move focus up or down the window stack
+ --, ((_4 , xK_m ), windows W.focusMaster)
+ , ((_4 , xK_j ), windows W.focusDown)
+ , ((_4 , xK_k ), windows W.focusUp)
+
+ -- modifying the window order
+ , ((_4S , xK_m ), windows W.swapMaster)
+ , ((_4S , xK_j ), windows W.swapDown)
+ , ((_4S , xK_k ), windows W.swapUp)
+
+ -- resizing the master/slave ratio
+ , ((_4 , xK_h ), sendMessage Shrink) -- %! Shrink the master area
+ , ((_4 , xK_l ), sendMessage Expand) -- %! Expand the master area
+
+ -- floating layer support
+ , ((_4 , xK_t ), withFocused $ windows . W.sink) -- make tiling
+
+ -- increase or decrease number of windows in the master area
+ , ((_4 , xK_comma ), sendMessage $ IncMasterN 1)
+ , ((_4 , xK_period ), sendMessage $ IncMasterN (-1))
+
+ , ((_4 , xK_a ), addWorkspacePrompt defaultXPConfig)
+ , ((_4 , xK_r ), renameWorkspace defaultXPConfig)
+ , ((_4 , xK_Delete ), removeEmptyWorkspace)
+
+ , ((_4 , xK_Return ), toggleWS)
+ --, (0 , xK_Menu ) & \k -> (k, gridselectWorkspace wsGSConfig { gs_navigate = makeGSNav k } W.view)
+ --, (_4 , xK_v ) & \k -> (k, gridselectWorkspace wsGSConfig { gs_navigate = makeGSNav k } W.view)
+ --, (_4S , xK_v ) & \k -> (k, gridselectWorkspace wsGSConfig { gs_navigate = makeGSNav k } W.shift)
+ --, (_4 , xK_b ) & \k -> (k, goToSelected wGSConfig { gs_navigate = makeGSNav k })
+ ]
+ where
+ _4 = mod4Mask
+ _C = controlMask
+ _S = shiftMask
+ _M = mod1Mask
+ _4C = _4 .|. _C
+ _4S = _4 .|. _S
+ _4M = _4 .|. _M
+ _4CM = _4 .|. _C .|. _M
+ _4SM = _4 .|. _S .|. _M
+
+
+pagerConfig :: PagerConfig
+pagerConfig = defaultPagerConfig
+ { pc_font = myFont
+ , pc_cellwidth = 64
+ --, pc_cellheight = 36 -- TODO automatically keep screen aspect
+ --, pc_borderwidth = 1
+ --, pc_matchcolor = "#f0b000"
+ , pc_matchmethod = MatchPrefix
+ --, pc_colors = pagerWorkspaceColors
+ , pc_windowColors = windowColors
+ }
+ where
+ windowColors _ _ _ True _ = ("#ef4242","#ff2323")
+ windowColors wsf m c u wf = do
+ let def = defaultWindowColors wsf m c u wf
+ if m == False && wf == True
+ then ("#402020", snd def)
+ else def
+
+horseConfig :: RhombusConfig
+horseConfig = defaultRhombusConfig
+ { rc_font = myFont
+ , rc_cellwidth = 64
+ --, rc_cellheight = 36 -- TODO automatically keep screen aspect
+ --, rc_borderwidth = 1
+ --, rc_matchcolor = "#f0b000"
+ , rc_matchmethod = MatchPrefix
+ --, rc_colors = pagerWorkspaceColors
+ --, rc_paint = myPaint