-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopencode.tmux
More file actions
executable file
·30 lines (25 loc) · 1.02 KB
/
Copy pathopencode.tmux
File metadata and controls
executable file
·30 lines (25 loc) · 1.02 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
#!/usr/bin/env bash
set -euo pipefail
PLUGIN_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
tmux_set_default() {
local option="$1" default_value="$2"
local current_value=""
current_value="$(tmux show-option -gqv "$option" 2>/dev/null || true)"
if [ -z "$current_value" ]; then
tmux set-option -gq "$option" "$default_value"
fi
}
tmux_set_default @opencode-key O
tmux_set_default @opencode-status-position right
tmux_set_default @opencode-popup-width 90%
tmux_set_default @opencode-popup-height 80%
tmux_set_default @opencode-stale-minutes 240
tmux_set_default @opencode-show-archived false
tmux_set_default @opencode-max-sessions 50
tmux_set_default @opencode-resume-target window
tmux_set_default @opencode-status-colors true
key="$(tmux show-option -gqv @opencode-key)"
width="$(tmux show-option -gqv @opencode-popup-width)"
height="$(tmux show-option -gqv @opencode-popup-height)"
tmux unbind-key "$key" 2>/dev/null || true
tmux bind-key "$key" display-popup -E -w "$width" -h "$height" "$PLUGIN_DIR/scripts/popup-run.sh"