2014-08-25 20:29:03 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
2014-08-28 22:17:02 +00:00
|
|
|
source "$CURRENT_DIR/scripts/variables.sh"
|
2014-08-25 20:29:03 +00:00
|
|
|
source "$CURRENT_DIR/scripts/helpers.sh"
|
|
|
|
|
|
|
|
set_save_bindings() {
|
|
|
|
local key_bindings=$(get_tmux_option "$save_option" "$default_save_key")
|
|
|
|
local key
|
|
|
|
for key in $key_bindings; do
|
2014-08-29 16:59:14 +00:00
|
|
|
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/save.sh"
|
2014-08-25 20:29:03 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
set_restore_bindings() {
|
|
|
|
local key_bindings=$(get_tmux_option "$restore_option" "$default_restore_key")
|
|
|
|
local key
|
|
|
|
for key in $key_bindings; do
|
2014-08-29 16:59:14 +00:00
|
|
|
tmux bind-key "$key" run-shell "$CURRENT_DIR/scripts/restore.sh"
|
2014-08-25 20:29:03 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-08-28 22:17:02 +00:00
|
|
|
set_default_strategies() {
|
2015-04-23 12:22:55 +00:00
|
|
|
tmux set-option -gq "${restore_process_strategy_option}irb" "default_strategy"
|
2014-08-28 22:17:02 +00:00
|
|
|
}
|
|
|
|
|
2015-02-12 11:48:06 +00:00
|
|
|
set_script_path_options() {
|
2015-04-23 12:22:55 +00:00
|
|
|
tmux set-option -gq "$save_path_option" "$CURRENT_DIR/scripts/save.sh"
|
|
|
|
tmux set-option -gq "$restore_path_option" "$CURRENT_DIR/scripts/restore.sh"
|
2015-02-12 11:48:06 +00:00
|
|
|
}
|
|
|
|
|
2014-08-25 20:29:03 +00:00
|
|
|
main() {
|
|
|
|
set_save_bindings
|
|
|
|
set_restore_bindings
|
2014-08-28 22:17:02 +00:00
|
|
|
set_default_strategies
|
2015-02-12 11:48:06 +00:00
|
|
|
set_script_path_options
|
2014-08-25 20:29:03 +00:00
|
|
|
}
|
|
|
|
main
|