add `@resurrect-confirm-{save,restore}` options
parent
cff343cf9e
commit
b499ddacc0
|
@ -6,18 +6,34 @@ source "$CURRENT_DIR/scripts/variables.sh"
|
|||
source "$CURRENT_DIR/scripts/helpers.sh"
|
||||
|
||||
set_save_bindings() {
|
||||
local should_confirm_save=$(get_tmux_option "$confirm_save_option" "$default_confirm_save")
|
||||
local command
|
||||
if [ "$should_confirm_save" == "on" ]; then
|
||||
command="confirm-before -y -p \"$confirm_save_prompt\" \"run-shell \\\"$CURRENT_DIR/scripts/save.sh\\\"\""
|
||||
else
|
||||
command="run-shell \"$CURRENT_DIR/scripts/save.sh\""
|
||||
fi
|
||||
|
||||
local key_bindings=$(get_tmux_option "$save_option" "$default_save_key")
|
||||
local key
|
||||
for key in $key_bindings; do
|
||||
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/save.sh"
|
||||
tmux bind-key "$key" $command
|
||||
done
|
||||
}
|
||||
|
||||
set_restore_bindings() {
|
||||
local should_confirm_restore=$(get_tmux_option "$confirm_restore_option" "$default_confirm_restore")
|
||||
local command
|
||||
if [ "$should_confirm_restore" == "on" ]; then
|
||||
command="confirm-before -y -p \"$confirm_restore_prompt\" \"run-shell \\\"$CURRENT_DIR/scripts/restore.sh\\\"\""
|
||||
else
|
||||
command="run-shell \"$CURRENT_DIR/scripts/restore.sh\""
|
||||
fi
|
||||
|
||||
local key_bindings=$(get_tmux_option "$restore_option" "$default_restore_key")
|
||||
local key
|
||||
for key in $key_bindings; do
|
||||
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/restore.sh"
|
||||
tmux bind-key "$key" $command
|
||||
done
|
||||
}
|
||||
|
||||
|
|
|
@ -2,10 +2,16 @@
|
|||
default_save_key="C-s"
|
||||
save_option="@resurrect-save"
|
||||
save_path_option="@resurrect-save-script-path"
|
||||
default_confirm_save="off"
|
||||
confirm_save_option="@resurrect-confirm-save"
|
||||
confirm_save_prompt="Save tmux environment? (Y/n)"
|
||||
|
||||
default_restore_key="C-r"
|
||||
restore_option="@resurrect-restore"
|
||||
restore_path_option="@resurrect-restore-script-path"
|
||||
default_confirm_restore="off"
|
||||
confirm_restore_option="@resurrect-confirm-restore"
|
||||
confirm_restore_prompt="Restore tmux environment? (Y/n)"
|
||||
|
||||
# default processes that are restored
|
||||
default_proc_list_option="@resurrect-default-processes"
|
||||
|
|
Loading…
Reference in New Issue