Commit 8c4ff9ba authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Update tmux-display-helper with tmux systemd unit

parent 3b6f97ab
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -84,18 +84,15 @@ get_var() {
}


if has systemd-run; then
	launch() { systemd-run --scope --user "$@"; }
else
	launch() { setsid "$@"; }
fi


start_client() {
	[ $# -eq 1 ] || bad_arg "start-client takes no arguments"
	[ -z "$TMUX" ] || die "this command must be run from outside of tmux"
	if ! tmux has-session; then
		launch tmux start-server
		if has systemctl; then
			systemctl --user start tmux.service
		else
			setsid tmux start-server
		fi
	fi
	set_var DISPLAY "$DISPLAY"
	tmux attach-session; code=$?