Skip to content

Commit

Permalink
tmux: add systemd service
Browse files Browse the repository at this point in the history
Add a systemd service so a tmux session is started at boot. It depends
on the graphical session to be fully initialized so that we inherit most
of the env variables as we would with a typical terminal emulator.

With this, a new directory was created and tmux.conf was moved
accordingly,

Signed-off-by: Nuno Sa <[email protected]>
  • Loading branch information
nunojsa committed Apr 18, 2024
1 parent 6969a95 commit d415797
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tmux/tmux-desktop.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-License-Identifier: GPL-2.0
#
# tmux systemd service. This is called tmux-desktop as the main
# usage for it is to use it on local machines with a desktop environment
# installed. Hence, we just start the new session after the graphical
# environment is fully initialized so that we inherit almost all the
# env variables so that we have the same ones as with a typical terminal
# emulator as terminator.
#
# !\TODO: Check if the graphical-session.target is generic across DEs
# (at least on xfce) so that this unit can be used on all my machines.

[Unit]
Description=Start tmux in detached session
Requires=graphical-session.target
After=graphical-session.target

[Service]
Type=forking
ExecStart=/usr/bin/tmux new-session -s %u -d

[Install]
WantedBy=graphical-session.target
File renamed without changes.

0 comments on commit d415797

Please sign in to comment.