-
Notifications
You must be signed in to change notification settings - Fork 3
/
theme.tmux
executable file
·50 lines (35 loc) · 1.25 KB
/
theme.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
44
45
46
47
48
49
#!/bin/bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/scripts/helpers.sh"
main() {
local toggle_flag="$1"
local theme_dark_mode="$(tmux show-option -gqv "@theme-dark-mode")"
[[ "${theme_dark_mode}" != "on" ]] && theme_dark_mode="off"
local theme_dark_mode_setto="$(tmux show-option -gqv "@theme-dark-mode-setto")"
if [[ "${toggle_flag}" = "toggle" ]]; then
# ---- theme should have been initialized already (existing tmux themes instance) ---
theme_dark_mode_toggle
# ---- theme should have been initialized already (existing tmux themes instance) ---
else
# ---- Initialize theme.tmux instance---
theme_dark_mode_bind_key
theme_env_setup
if [[ "${theme_dark_mode_setto}" = "on" ]]; then
theme_dark_mode_on
tmux set -g @theme-dark-mode-setto 'on'
elif [[ "${theme_dark_mode_setto}" = "off" ]]; then
theme_dark_mode_off
tmux set -g @theme-dark-mode-setto 'off'
else
if [[ "${theme_dark_mode}" = "on" ]]; then
theme_dark_mode_on
tmux set -g @theme-dark-mode-setto 'on'
else
theme_dark_mode_off
tmux set -g @theme-dark-mode-setto 'off'
fi
fi
# ---- Initialize theme.tmux instance---
fi
}
main "$1"