summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs
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/5pkgs
parent5030b74cc5c578bb82619a24592504a6008f1a10 (diff)
parent8705b4dbc8e8cf0c4e09c114daad3f96026520ab (diff)
Merge branch 'master' of prism.r:stockholm
Diffstat (limited to 'tv/5pkgs')
-rw-r--r--tv/5pkgs/haskell/xmonad-tv/shell.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/tv/5pkgs/haskell/xmonad-tv/shell.nix b/tv/5pkgs/haskell/xmonad-tv/shell.nix
index 936e69627..6ca00bc05 100644
--- a/tv/5pkgs/haskell/xmonad-tv/shell.nix
+++ b/tv/5pkgs/haskell/xmonad-tv/shell.nix
@@ -46,7 +46,7 @@ in
xmonad_restart() {(
set -efu
cd "$WORKDIR"
- if systemctl is-active xmonad; then
+ if systemctl --quiet is-active xmonad; then
sudo systemctl stop xmonad
cp -b "$config_XMONAD_CACHE_DIR"/xmonad.state "$CACHEDIR"/
echo "xmonad.state: $(cat "$CACHEDIR"/xmonad.state)"
@@ -59,9 +59,14 @@ in
xmonad_yield() {(
set -efu
- "$xmonad" --shutdown
- cp -b "$CACHEDIR"/xmonad.state "$config_XMONAD_CACHE_DIR"/
- sudo systemctl start xmonad
+ if ! systemctl --quiet is-active xmonad; then
+ "$xmonad" --shutdown
+ cp -b "$CACHEDIR"/xmonad.state "$config_XMONAD_CACHE_DIR"/
+ sudo systemctl start xmonad
+ else
+ echo "xmonad.service is already running" >&2
+ exit -1
+ fi
)}
export PATH=${config.systemd.services.xmonad.path}:$PATH