summaryrefslogtreecommitdiffstats
path: root/tv/2configs/xserver
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2019-02-26 08:58:51 +0100
committermakefu <github@syntax-fehler.de>2019-02-26 08:58:51 +0100
commite437c7d17b4accf9c18d2aa17a0ec98a171d8f3f (patch)
treebbb65961d3eaaa7f14461383290db99f391bb6cb /tv/2configs/xserver
parent6da32a5952faf38c92c7b289cc6ae0881ec4aa36 (diff)
parent2db5d56cf2e252822f38900ef9436d7b118476a9 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'tv/2configs/xserver')
-rw-r--r--tv/2configs/xserver/default.nix19
1 files changed, 16 insertions, 3 deletions
diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix
index f68e8e681..051e12ef0 100644
--- a/tv/2configs/xserver/default.nix
+++ b/tv/2configs/xserver/default.nix
@@ -48,10 +48,24 @@ in {
systemd.services.xmonad = let
xmonad = "${pkgs.haskellPackages.xmonad-tv}/bin/xmonad";
- xmonad-prepare = pkgs.writeDash "xmonad-prepare" ''
+ xmonad-start = pkgs.writeDash "xmonad-start" ''
${pkgs.coreutils}/bin/mkdir -p "$XMONAD_CACHE_DIR"
${pkgs.coreutils}/bin/mkdir -p "$XMONAD_CONFIG_DIR"
${pkgs.coreutils}/bin/mkdir -p "$XMONAD_DATA_DIR"
+
+ f=$HOME/.dbus/session-bus/$(${pkgs.coreutils}/bin/cat /etc/machine-id)-${
+ toString config.services.xserver.display
+ }
+ if test -e "$f" &&
+ . "$f" &&
+ ${pkgs.coreutils}/bin/kill -0 "$DBUS_SESSION_BUS_PID"
+ then
+ export DBUS_SESSION_BUS_ADDRESS
+ else
+ eval "$(${pkgs.dbus.lib}/bin/dbus-launch --sh-syntax)"
+ fi
+
+ exec ${xmonad}
'';
xmonad-ready = pkgs.writeDash "xmonad-ready" ''
{
@@ -97,8 +111,7 @@ in {
"/run/wrappers" # for su
];
serviceConfig = {
- ExecStartPre = "@${xmonad-prepare} xmonad-prepare";
- ExecStart = "@${xmonad} xmonad-${currentSystem}";
+ ExecStart = "@${xmonad-start} xmonad-${currentSystem}";
ExecStop = "@${xmonad} xmonad-${currentSystem} --shutdown";
SyslogIdentifier = "xmonad";
User = cfg.user.name;