-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhuckleberry.tmux
More file actions
executable file
·33 lines (27 loc) · 1.27 KB
/
huckleberry.tmux
File metadata and controls
executable file
·33 lines (27 loc) · 1.27 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
#!/usr/bin/env bash
# TPM entry point — sources config, binds the popup key.
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# --- Dependency checks -------------------------------------------------------
if ! command -v fzf &>/dev/null; then
tmux display-message "huckleberry: fzf not found — install fzf to use this plugin"
# shellcheck disable=SC2317
return 2>/dev/null || exit 1
fi
source "${CURRENT_DIR}/scripts/helpers.sh"
source "${CURRENT_DIR}/scripts/variables.sh"
get_tmux_option "$HUCKLEBERRY_BIND" "$HUCKLEBERRY_BIND_DEFAULT"; bind_key="$REPLY"
get_tmux_option "$HUCKLEBERRY_WIDTH" "$HUCKLEBERRY_WIDTH_DEFAULT"; width="$REPLY"
get_tmux_option "$HUCKLEBERRY_HEIGHT" "$HUCKLEBERRY_HEIGHT_DEFAULT"; height="$REPLY"
get_tmux_option "$HUCKLEBERRY_X" "$HUCKLEBERRY_X_DEFAULT"; pos_x="$REPLY"
get_tmux_option "$HUCKLEBERRY_Y" "$HUCKLEBERRY_Y_DEFAULT"; pos_y="$REPLY"
get_tmux_option "$HUCKLEBERRY_TITLE" "$HUCKLEBERRY_TITLE_DEFAULT"; title="$REPLY"
get_tmux_option "$HUCKLEBERRY_BORDER_LINES" "$HUCKLEBERRY_BORDER_LINES_DEFAULT"; border_lines="$REPLY"
tmux bind-key "$bind_key" display-popup \
-E \
-b "$border_lines" \
-w "$width" \
-h "$height" \
-x "$pos_x" \
-y "$pos_y" \
-T "$title" \
"${CURRENT_DIR}/scripts/huckleberry.sh"