-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
#!/usr/bin/env bash | ||
# -*- mode: sh -*- | ||
# -*- mode: sh; sh-shell: bash -*- | ||
|
||
basedir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
# shellcheck source=lib/tmux.bash | ||
. "${basedir}/lib/tmux.bash" | ||
default_key_binding_switch="g" | ||
tmux_option_switch="@per-project-session-switch" | ||
|
||
main() { | ||
local switch_key | ||
switch_key="$(tmux_get_option "@per-project-session-switch" 'g')" | ||
# shellcheck source=scripts/helpers.sh | ||
. "${CURRENT_DIR}/scripts/helpers.sh" | ||
|
||
set_new_session_binding() { | ||
local key | ||
key="$(get_tmux_option "$tmux_option_switch" "$default_key_binding_switch")" | ||
|
||
tmux bind-key "$switch_key" run-shell -b "${basedir}/libexec/switch-session" | ||
tmux bind-key "$key" run-shell -b "${CURRENT_DIR}/scripts/switch_session.sh" | ||
} | ||
|
||
main() { | ||
set_new_session_binding | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tmux_get_option() { | ||
get_tmux_option() { | ||
local option | ||
local default | ||
local value | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters