summaryrefslogtreecommitdiffstats
path: root/tv/2configs/xserver/default.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-12-16 20:28:28 +0100
committerjeschli <jeschli@gmail.com>2018-12-16 20:28:28 +0100
commit8605ac91ae3a3859ab906a5fa2e9b0e3dfcd6e1e (patch)
tree77618847347d2526897e94da744ab57588947567 /tv/2configs/xserver/default.nix
parent5030b74cc5c578bb82619a24592504a6008f1a10 (diff)
parent8705b4dbc8e8cf0c4e09c114daad3f96026520ab (diff)
Merge branch 'master' of prism.r:stockholm
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;
};