aboutsummaryrefslogtreecommitdiffstats
path: root/user/tmux.service
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2015-03-20 03:33:47 +0100
committerDavid Runge <dave@sleepmap.de>2015-03-20 03:33:47 +0100
commitaeee1ec852141ebd07d304f817fb88886b1ab2f6 (patch)
tree8128446a51c976561d786a7455198fe217471f9b /user/tmux.service
parent96ad7ebbb201e198385f8a2ef8808373a6f85b1f (diff)
downloaduenv-aeee1ec852141ebd07d304f817fb88886b1ab2f6.tar.gz
uenv-aeee1ec852141ebd07d304f817fb88886b1ab2f6.tar.bz2
uenv-aeee1ec852141ebd07d304f817fb88886b1ab2f6.tar.xz
uenv-aeee1ec852141ebd07d304f817fb88886b1ab2f6.zip
tmux.service: Adding a tmux systemd --user file that will launch a named tmux user session to attach to within a separate TMUX_TMPDIR set to the user's run directory.
Diffstat (limited to 'user/tmux.service')
-rw-r--r--user/tmux.service14
1 files changed, 14 insertions, 0 deletions
diff --git a/user/tmux.service b/user/tmux.service
new file mode 100644
index 0000000..089e759
--- /dev/null
+++ b/user/tmux.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Start tmux in detached session
+After=network.target local-fs.target
+ConditionFileIsExecutable=/usr/bin/tmux
+
+[Service]
+Type=forking
+KillMode=control-group
+Environment=TMUX_TMPDIR=/run/user/%U/tmux
+ExecStart=/usr/bin/tmux new-session -s user -d
+ExecStop=/usr/bin/tmux kill-session -t user
+
+[Install]
+WantedBy=default.target