diff options
author | jeschli <jeschli@gmail.com> | 2019-04-02 19:38:35 +0200 |
---|---|---|
committer | jeschli <jeschli@gmail.com> | 2019-04-02 19:38:35 +0200 |
commit | f8b88080d5bb27e4a6b35b26d6036de40517ba57 (patch) | |
tree | f8a077997ca889950daa0cb5ec11cc486f420bbe /tv/2configs/xserver | |
parent | 17712c90772d68f174f579e570fa23a8fa674245 (diff) | |
parent | 6654f03b09b7b80e3ee6339c92e6172579349744 (diff) |
:Merge branch 'master' of prism.r:stockholm
Diffstat (limited to 'tv/2configs/xserver')
-rw-r--r-- | tv/2configs/xserver/default.nix | 19 |
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; |