-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdevcontainers.tmux
More file actions
executable file
·38 lines (28 loc) · 1.05 KB
/
devcontainers.tmux
File metadata and controls
executable file
·38 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/scripts/helpers.sh"
devcontainers_interpolations=(
"\#{devcontainers_workspace}"
"\#{devcontainers_status}"
)
devcontainers_commands=(
"#($CURRENT_DIR/scripts/statusbar/workspace.sh)"
"#($CURRENT_DIR/scripts/statusbar/status.sh)"
)
# Usage
# # interpolate_tmux_option <option>
interpolate_tmux_option() {
local option=$1
local option_value=$(get_tmux_option "$option")
for ((i = 0; i < ${#devcontainers_commands[@]}; i++)); do
option_value=${option_value/${devcontainers_interpolations[$i]}/${devcontainers_commands[$i]}}
done
set_tmux_option "$option" "$option_value"
}
main() {
interpolate_tmux_option "status-right"
interpolate_tmux_option "status-left"
tmux bind-key $(get_tmux_option "@devcontainers_exec_key" "E") "run -b '$CURRENT_DIR/scripts/commands.sh run_exec_in_window'"
tmux bind-key $(get_tmux_option "@devcontainers_menu_key" "C-e") "run -b '$CURRENT_DIR/scripts/menu.sh show_menu'"
}
main