summaryrefslogtreecommitdiffstats
path: root/tv/2configs/xserver/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2018-12-12 17:53:38 +0100
committermakefu <github@syntax-fehler.de>2018-12-12 17:53:38 +0100
commit97aaf34c3311291ac47967ac1313e2d955b8228a (patch)
treed119d7ae674863f645e840e14bde0fbfe6f6a16c /tv/2configs/xserver/default.nix
parent2e18ee84f02c0d7abcf936b1d39c42ab8e75825c (diff)
parent25cf61f6a74b69656d15f52021f25a6c2e4068e6 (diff)
Merge remote-tracking branch 'lass/master' into HEAD
Diffstat (limited to 'tv/2configs/xserver/default.nix')
-rw-r--r--tv/2configs/xserver/default.nix42
1 files changed, 21 insertions, 21 deletions
diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix
index 8d4b13fad..f68e8e681 100644
--- a/tv/2configs/xserver/default.nix
+++ b/tv/2configs/xserver/default.nix
@@ -48,31 +48,35 @@ in {
systemd.services.xmonad = let
xmonad = "${pkgs.haskellPackages.xmonad-tv}/bin/xmonad";
+ xmonad-prepare = pkgs.writeDash "xmonad-prepare" ''
+ ${pkgs.coreutils}/bin/mkdir -p "$XMONAD_CACHE_DIR"
+ ${pkgs.coreutils}/bin/mkdir -p "$XMONAD_CONFIG_DIR"
+ ${pkgs.coreutils}/bin/mkdir -p "$XMONAD_DATA_DIR"
+ '';
+ xmonad-ready = pkgs.writeDash "xmonad-ready" ''
+ {
+ ${pkgs.xorg.xhost}/bin/xhost +SI:localuser:${cfg.user.name}
+ ${pkgs.xorg.xhost}/bin/xhost -LOCAL:
+ } &
+ ${pkgs.xorg.xmodmap}/bin/xmodmap ${import ./Xmodmap.nix args} &
+ ${pkgs.xorg.xrdb}/bin/xrdb ${import ./Xresources.nix args} &
+ ${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' &
+ wait
+ '';
in {
wantedBy = [ "graphical.target" ];
requires = [ "xserver.service" ];
environment = {
DISPLAY = ":${toString config.services.xserver.display}";
-
FZMENU_FZF_DEFAULT_OPTS = toString [
"--color=dark,border:126,bg+:090"
"--inline-info"
];
-
XMONAD_CACHE_DIR = cfg.cacheDir;
XMONAD_CONFIG_DIR = cfg.configDir;
XMONAD_DATA_DIR = cfg.dataDir;
-
- XMONAD_STARTUP_HOOK = pkgs.writeDash "xmonad-startup-hook" ''
- ${pkgs.xorg.xhost}/bin/xhost +LOCAL: &
- ${pkgs.xorg.xmodmap}/bin/xmodmap ${import ./Xmodmap.nix args} &
- ${pkgs.xorg.xrdb}/bin/xrdb ${import ./Xresources.nix args} &
- ${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' &
- wait
- '';
-
- # XXX JSON is close enough :)
- XMONAD_WORKSPACES0_FILE = pkgs.writeText "xmonad.workspaces0" (toJSON [
+ XMONAD_STARTUP_HOOK = xmonad-ready;
+ XMONAD_WORKSPACES0_FILE = pkgs.writeJSON "xmonad-workspaces0.json" [
"Dashboard" # we start here
"23"
"cr"
@@ -82,7 +86,7 @@ in {
"mail"
"stockholm"
"za" "zh" "zj" "zs"
- ]);
+ ];
};
path = [
config.tv.slock.package
@@ -93,14 +97,10 @@ in {
"/run/wrappers" # for su
];
serviceConfig = {
- SyslogIdentifier = "xmonad";
- ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${toString [
- "\${XMONAD_CACHE_DIR}"
- "\${XMONAD_CONFIG_DIR}"
- "\${XMONAD_DATA_DIR}"
- ]}";
- ExecStart = "@${xmonad} xmonad-${currentSystem} ";
+ ExecStartPre = "@${xmonad-prepare} xmonad-prepare";
+ ExecStart = "@${xmonad} xmonad-${currentSystem}";
ExecStop = "@${xmonad} xmonad-${currentSystem} --shutdown";
+ SyslogIdentifier = "xmonad";
User = cfg.user.name;
WorkingDirectory = cfg.user.home;
};