-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroxo.tmux
More file actions
executable file
·95 lines (72 loc) · 2.84 KB
/
roxo.tmux
File metadata and controls
executable file
·95 lines (72 loc) · 2.84 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env bash
PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
get_tmux_option() {
local option value default
option="$1"
default="$2"
value="$(tmux show-option -gqv "$option")"
if [ -n "$value" ]; then
echo "$value"
else
echo "$default"
fi
}
set() {
local option=$1
local value=$2
tmux_commands+=(set-option -gq "$option" "$value" ";")
}
setw() {
local option=$1
local value=$2
tmux_commands+=(set-window-option -gq "$option" "$value" ";")
}
main() {
# command array
local tmux_commands=()
# shellcheck source=roxo.tmuxtheme
source /dev/stdin <<<"$(sed -e "/^[^#].*=/s/^/local /" "${PLUGIN_DIR}/roxo.tmuxtheme")"
# default icons
local status_separator="█"
local user_icon=""
local window_icon=""
local session_icon=""
local host_icon=""
# status
set status "on"
set status-bg "${thm_bg}"
set status-justify "left"
set status-left-length "100"
set status-right-length "100"
# messages
set message-style "fg=${thm_cyan},bg=${thm_bg},align=centre"
set message-command-style "fg=${thm_cyan},bg=${thm_bg},align=centre"
# panes
set pane-border-style "fg=${thm_magenta}"
set pane-active-border-style "fg=${thm_blue}"
# windows
setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none"
setw window-status-separator ""
setw window-status-style "fg=${thm_fg},bg=${thm_bg},none"
# directory tabs
setw window-status-format "#[fg=$thm_bg,bg=$thm_magenta] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} "
setw window-status-current-format "#[fg=$thm_bg,bg=$thm_orange bold] #I #[fg=$thm_fg,bg=$thm_bg] #{b:pane_current_path} "
# modes
setw clock-mode-colour "${thm_blue}"
setw mode-style "fg=${thm_pink} bg=${thm_bg} bold"
## --- Statusline --- ##
local show_window
readonly show_window="#[fg=$thm_magenta,bg=$thm_bg,nobold,nounderscore,noitalics]$status_separator#[fg=$thm_bg,bg=$thm_magenta,nobold,nounderscore,noitalics]$window_icon#[fg=$thm_magenta,bg=$thm_bg,nobold,nounderscore,noitalics]$status_separator#[fg=$thm_fg,bg=$thm_bg] #W #{?client_prefix,#[fg=$thm_red]"
local show_session
readonly show_session="#[fg=$thm_green]#[bg=$thm_bg]$status_separator#{?client_prefix,#[bg=$thm_green],#[bg=$thm_green]}#[fg=$thm_bg]$session_icon#[fg=$thm_green]#[bg=$thm_bg]$status_separator#[fg=$thm_fg,bg=$thm_bg] #S "
local show_user
readonly show_user="#[fg=$thm_pink,bg=$thm_bg]$status_separator#[fg=$thm_bg,bg=$thm_pink]$user_icon#[fg=$thm_pink,bg=$thm_bg]$status_separator#[fg=$thm_fg,bg=$thm_bg] #(whoami) "
local show_host
readonly show_host="#[fg=$thm_cyan,bg=$thm_bg]$status_separator#[fg=$thm_bg,bg=$thm_cyan]$host_icon#[fg=$thm_cyan,bg=$thm_bg]$status_separator#[fg=$thm_fg,bg=$thm_bg] #H "
local right_column1=$show_user$show_host
local right_column2=$show_session$show_window
set status-left ""
set status-right "${right_column1}${right_column2}"
tmux "${tmux_commands[@]}"
}
main "$@"