From 4c84c4062fbf8588917a1f45d8cddbe607318763 Mon Sep 17 00:00:00 2001 From: kqwyf Date: Wed, 28 Apr 2021 13:58:44 +0800 Subject: [PATCH] enable user to set the path of tmux-resurrect's save.sh. replace the hard-coded path by a more elegant one. --- scripts/handle_tmux_automatic_start/systemd_enable.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/handle_tmux_automatic_start/systemd_enable.sh b/scripts/handle_tmux_automatic_start/systemd_enable.sh index d37c889..a724c94 100755 --- a/scripts/handle_tmux_automatic_start/systemd_enable.sh +++ b/scripts/handle_tmux_automatic_start/systemd_enable.sh @@ -10,6 +10,7 @@ template() { shift local options="$@" local content="" + local resurrect_save_script_path="$(get_tmux_option "$resurrect_save_path_option" "$(realpath ${CURRENT_DIR}/../../../tmux-resurrect/scripts/save.sh)")" read -r -d '' content <<-EOF [Unit] @@ -21,7 +22,7 @@ template() { Environment=DISPLAY=:0 ExecStart=/usr/bin/tmux ${systemd_tmux_server_start_cmd} - ExecStop=${HOME}/.tmux/plugins/tmux-resurrect/scripts/save.sh + ExecStop=${resurrect_save_script_path} ExecStop=/usr/bin/tmux kill-server KillMode=none