summaryrefslogtreecommitdiffstats
path: root/tv
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-12-05 16:34:25 +0100
committertv <tv@krebsco.de>2017-12-05 16:34:25 +0100
commite5ab9b686ad7337d54e5d2b2ff6e8f88ac7a68f1 (patch)
treebe089f63bd882a26066fbf16d8607bb7cbea8d80 /tv
parentf2bdf5590eb97e6fde86e332f93a733005dfb4a7 (diff)
tv xmonad: replace XMONAD_STATE by XMONAD_*_DIR
Diffstat (limited to 'tv')
-rw-r--r--tv/2configs/xserver/default.nix14
-rw-r--r--tv/5pkgs/simple/xmonad-tv/default.nix13
2 files changed, 13 insertions, 14 deletions
diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix
index 6688984e2..7ba78b974 100644
--- a/tv/2configs/xserver/default.nix
+++ b/tv/2configs/xserver/default.nix
@@ -2,6 +2,9 @@
with import <stockholm/lib>;
let
cfg = {
+ cacheDir = cfg.dataDir;
+ configDir = "/var/empty";
+ dataDir = "/run/xdg/${cfg.user.name}/xmonad";
user = config.krebs.build.user;
};
in {
@@ -56,6 +59,10 @@ in {
environment = {
DISPLAY = ":${toString config.services.xserver.display}";
+ 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} &
@@ -64,8 +71,6 @@ in {
wait
'';
- XMONAD_STATE = "/tmp/xmonad.state";
-
# XXX JSON is close enough :)
XMONAD_WORKSPACES0_FILE = pkgs.writeText "xmonad.workspaces0" (toJSON [
"Dashboard" # we start here
@@ -81,6 +86,11 @@ in {
};
serviceConfig = {
SyslogIdentifier = "xmonad";
+ ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${toString [
+ "\${XMONAD_CACHE_DIR}"
+ "\${XMONAD_CONFIG_DIR}"
+ "\${XMONAD_DATA_DIR}"
+ ]}";
ExecStart = "${pkgs.xmonad-tv}/bin/xmonad";
ExecStop = "${pkgs.xmonad-tv}/bin/xmonad --shutdown";
User = cfg.user.name;
diff --git a/tv/5pkgs/simple/xmonad-tv/default.nix b/tv/5pkgs/simple/xmonad-tv/default.nix
index 94554f57c..94c70153d 100644
--- a/tv/5pkgs/simple/xmonad-tv/default.nix
+++ b/tv/5pkgs/simple/xmonad-tv/default.nix
@@ -71,7 +71,7 @@ main = getArgs >>= \case
mainNoArgs :: IO ()
mainNoArgs = do
workspaces0 <- getWorkspaces0
- xmonad'
+ xmonad
-- $ withUrgencyHookC dzenUrgencyHook { args = ["-bg", "magenta", "-fg", "magenta", "-h", "2"], duration = 500000 }
-- urgencyConfig { remindWhen = Every 1 }
-- $ withUrgencyHook borderUrgencyHook "magenta"
@@ -95,17 +95,6 @@ mainNoArgs = do
}
-xmonad' :: (LayoutClass l Window, Read (l Window)) => XConfig l -> IO ()
-xmonad' conf = do
- path <- getEnv "XMONAD_STATE"
- try (readFile path) >>= \case
- Right content -> do
- hPutStrLn stderr ("resuming from " ++ path)
- withArgs ("--resume" : lines content) (xmonad conf)
- Left e -> do
- hPutStrLn stderr (displaySomeException e)
- xmonad conf
-
getWorkspaces0 :: IO [String]
getWorkspaces0 =
try (getEnv "XMONAD_WORKSPACES0_FILE") >>= \case