-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux-tweaks.tmux
executable file
·43 lines (35 loc) · 1.08 KB
/
tmux-tweaks.tmux
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
39
40
41
42
43
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
themes_dir="${CURRENT_DIR}/themes"
scripts_dir="${CURRENT_DIR}/scripts"
colours_dir="${CURRENT_DIR}/colours"
icons_dir="${CURRENT_DIR}/icons"
actions_dir="${CURRENT_DIR}/actions"
source "${scripts_dir}/helpers.sh"
tmux bind u source-file "${actions_dir}/url.action"
tmux bind e run-shell '~/.tmux/plugins/tmux-tweaks/export/export.tmux set-export'
tmux bind E run-shell '~/.tmux/plugins/tmux-tweaks/export/export.tmux export'
tmux bind C-E run-shell '~/.tmux/plugins/tmux-tweaks/export/export.tmux load-theme'
theme_option="@tweaks_theme"
default_theme='tmux-tweaks'
is_opt_set() {
local opt=$1
local val=$(tmux show-option -gqv "$opt")
[ -z $val ] && return 1 || return 0
}
get_tmux_option() {
local option="$1"
local default_value="$2"
local option_value="$(tmux show-option -gqv "$option")"
if [ -n "$option_value" ]; then
echo "$option_value"
else
echo "$default_value"
fi
}
main() {
if is_opt_set "$theme_option"; then
tmux run-shell "${themes_dir}/themes.tmux"
fi
}
main