summaryrefslogtreecommitdiffstats
path: root/tv/2configs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-05-25 01:37:52 +0200
committertv <tv@krebsco.de>2016-05-25 01:59:29 +0200
commitcd62dead8d077e29a078ee23eea8894f9d0ef784 (patch)
treeb0394e1028e9f9a430abdb162c6e6ab58237516e /tv/2configs
parentae6a21d46a9f574ca98f60dc2c6576d0de12db1d (diff)
xmonad-tv: startupHook = $XMONAD_STARTUP_HOOK &
Diffstat (limited to 'tv/2configs')
-rw-r--r--tv/2configs/xserver/default.nix35
1 files changed, 10 insertions, 25 deletions
diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix
index 51e2432..efc06be 100644
--- a/tv/2configs/xserver/default.nix
+++ b/tv/2configs/xserver/default.nix
@@ -56,8 +56,8 @@ let
requires = [ "xserver.service" ];
environment = xmonad-environment;
serviceConfig = {
- ExecStart = "${xmonad-start}/bin/xmonad";
- ExecStop = "${xmonad-stop}/bin/xmonad-stop";
+ ExecStart = "${pkgs.xmonad-tv}/bin/xmonad-tv";
+ ExecStop = "${pkgs.xmonad-tv}/bin/xmonad-tv --shutdown";
User = user.name;
WorkingDirectory = user.home;
};
@@ -80,6 +80,14 @@ let
xmonad-environment = {
DISPLAY = ":${toString config.services.xserver.display}";
+
+ XMONAD_STARTUP_HOOK = pkgs.writeDash "xmonad-startup-hook" ''
+ ${pkgs.xorg.xhost}/bin/xhost +LOCAL: &
+ ${pkgs.xorg.xrdb}/bin/xrdb -merge ${import ./Xresources.nix args} &
+ ${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' &
+ wait
+ '';
+
XMONAD_STATE = "/tmp/xmonad.state";
# XXX JSON is close enough :)
@@ -96,29 +104,6 @@ let
]);
};
- xmonad-start = pkgs.writeScriptBin "xmonad" ''
- #! ${pkgs.bash}/bin/bash
- set -efu
- 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 ${pkgs.xmonad-tv}/bin/xmonad-tv
- '';
-
- xmonad-stop = pkgs.writeScriptBin "xmonad-stop" ''
- #! /bin/sh
- exec ${pkgs.xmonad-tv}/bin/xmonad-tv --shutdown
- '';
-
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.