add tmux systemd service

This commit is contained in:
thek4n 2024-04-03 14:20:21 +03:00
parent 2b1aa6a84b
commit d09449411b
3 changed files with 11 additions and 3 deletions

View File

@ -7,7 +7,11 @@ if \
[[ ! "$TERM" =~ tmux ]] && \ [[ ! "$TERM" =~ tmux ]] && \
command -v tmux &>/dev/null command -v tmux &>/dev/null
then then
exec tmux if systemctl -q --user is-active tmux; then
exec tmux -N -L "$USER" new
else
exec tmux
fi
fi fi
if [ -f "$HOME/.config/bash/sourcer" ]; then if [ -f "$HOME/.config/bash/sourcer" ]; then

View File

@ -5,7 +5,7 @@ After=default.target
[Service] [Service]
Type=simple Type=simple
ExecStart=/usr/bin/tmux -D ExecStart=/usr/bin/tmux -D -L %u
ExecStop=/usr/bin/tmux kill-server ExecStop=/usr/bin/tmux kill-server
Restart=on-failure Restart=on-failure

View File

@ -7,7 +7,11 @@ if \
[[ ! "$TERM" =~ tmux ]] && \ [[ ! "$TERM" =~ tmux ]] && \
command -v tmux &>/dev/null command -v tmux &>/dev/null
then then
exec tmux if systemctl -q --user is-active tmux; then
exec tmux -N -L "$USER" new
else
exec tmux
fi
fi fi
if [ -f "$ZDOTDIR/sourcer" ]; then if [ -f "$ZDOTDIR/sourcer" ]; then