mirror of
https://github.com/TECHNOFAB11/tmux2k.git
synced 2025-12-11 23:50:08 +01:00
refactor: update colors
This commit is contained in:
parent
81f4092ce6
commit
15b06d5196
1 changed files with 31 additions and 53 deletions
|
|
@ -1,11 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# setting the locale, some users have issues with different locales, this forces the correct one
|
|
||||||
export LC_ALL=en_US.UTF-8
|
export LC_ALL=en_US.UTF-8
|
||||||
|
|
||||||
current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
source "$current_dir"/utils.sh
|
source "$current_dir"/utils.sh
|
||||||
|
|
||||||
# set configuration option variables
|
|
||||||
show_powerline=$(get_tmux_option "@tmux2k-show-powerline" true)
|
show_powerline=$(get_tmux_option "@tmux2k-show-powerline" true)
|
||||||
show_refresh=$(get_tmux_option "@tmux2k-refresh-rate" 60)
|
show_refresh=$(get_tmux_option "@tmux2k-refresh-rate" 60)
|
||||||
show_left_icon=$(get_tmux_option "@tmux2k-show-left-icon" rocket)
|
show_left_icon=$(get_tmux_option "@tmux2k-show-left-icon" rocket)
|
||||||
|
|
@ -14,41 +13,39 @@ show_right_sep=$(get_tmux_option "@tmux2k-show-right-sep" )
|
||||||
win_left_sep=$(get_tmux_option "@tmux2k-window-left-sep" )
|
win_left_sep=$(get_tmux_option "@tmux2k-window-left-sep" )
|
||||||
win_right_sep=$(get_tmux_option "@tmux2k-window-right-sep" )
|
win_right_sep=$(get_tmux_option "@tmux2k-window-right-sep" )
|
||||||
show_flags=$(get_tmux_option "@tmux2k-show-flags" true)
|
show_flags=$(get_tmux_option "@tmux2k-show-flags" true)
|
||||||
|
|
||||||
IFS=' ' read -r -a lplugins <<<"$(get_tmux_option '@tmux2k-left-plugins' 'git cpu ram')"
|
IFS=' ' read -r -a lplugins <<<"$(get_tmux_option '@tmux2k-left-plugins' 'git cpu ram')"
|
||||||
IFS=' ' read -r -a rplugins <<<"$(get_tmux_option '@tmux2k-right-plugins' 'battery network time')"
|
IFS=' ' read -r -a rplugins <<<"$(get_tmux_option '@tmux2k-right-plugins' 'battery network time')"
|
||||||
|
|
||||||
white='#d5d5da'
|
|
||||||
black='#0a0a0f',
|
black='#0a0a0f',
|
||||||
gray='#15152a'
|
|
||||||
red='#ff001f',
|
|
||||||
green='#3dd50A',
|
|
||||||
yellow='#ffd21a',
|
|
||||||
blue='#1688f0',
|
blue='#1688f0',
|
||||||
purple='#BF58FF',
|
|
||||||
cyan='#11dddd',
|
cyan='#11dddd',
|
||||||
|
gray='#15152a'
|
||||||
|
green='#3dd50A',
|
||||||
orange='#ffb86c'
|
orange='#ffb86c'
|
||||||
pink='#ff79c6'
|
pink='#ff79c6'
|
||||||
light_purple='#bd93f9'
|
purple='#BF58FF',
|
||||||
|
red='#ff001f',
|
||||||
|
white='#d5d5da'
|
||||||
|
yellow='#ffd21a',
|
||||||
light_cyan='#8be9fd'
|
light_cyan='#8be9fd'
|
||||||
|
light_gray='#45455a'
|
||||||
light_green='#50fa7b'
|
light_green='#50fa7b'
|
||||||
|
light_purple='#bd93f9'
|
||||||
light_red='#ff0055'
|
light_red='#ff0055'
|
||||||
light_yellow='#f1fa8c'
|
light_yellow='#f1fa8c'
|
||||||
dark_gray='#282a36'
|
plugin_fg='#282a36'
|
||||||
light_gray='#45455a'
|
|
||||||
dark_gray='#282a36'
|
|
||||||
|
|
||||||
declare -A plugin_colors=(
|
declare -A plugin_colors=(
|
||||||
["git"]="green dark_gray"
|
["git"]="green plugin_fg"
|
||||||
["battery"]="pink dark_gray"
|
["battery"]="pink plugin_fg"
|
||||||
["gpu"]="orange dark_gray"
|
["gpu"]="orange plugin_fg"
|
||||||
["cpu"]="blue dark_gray"
|
["cpu"]="blue plugin_fg"
|
||||||
["ram"]="yellow dark_gray"
|
["ram"]="yellow plugin_fg"
|
||||||
["network"]="purple dark_gray"
|
["network"]="purple plugin_fg"
|
||||||
["bandwidth"]="purple dark_gray"
|
["bandwidth"]="purple plugin_fg"
|
||||||
["ping"]="purple dark_gray"
|
["ping"]="purple plugin_fg"
|
||||||
["weather"]="orange dark_gray"
|
["weather"]="orange plugin_fg"
|
||||||
["time"]="cyan dark_gray"
|
["time"]="cyan plugin_fg"
|
||||||
)
|
)
|
||||||
|
|
||||||
get_plugin_colors() {
|
get_plugin_colors() {
|
||||||
|
|
@ -97,30 +94,18 @@ build_status_bar() {
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
case $show_left_icon in
|
case $show_left_icon in
|
||||||
rocket)
|
rocket) left_icon="" ;;
|
||||||
left_icon=""
|
session) left_icon="#S" ;;
|
||||||
;;
|
window) left_icon="#W" ;;
|
||||||
session)
|
*) left_icon=$show_left_icon ;;
|
||||||
left_icon="#S"
|
|
||||||
;;
|
|
||||||
window)
|
|
||||||
left_icon="#W"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
left_icon=$show_left_icon
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# sets refresh interval to every 5 seconds
|
|
||||||
tmux set-option -g status-interval "$show_refresh"
|
tmux set-option -g status-interval "$show_refresh"
|
||||||
|
|
||||||
# set length
|
|
||||||
tmux set-option -g status-left-length 100
|
tmux set-option -g status-left-length 100
|
||||||
tmux set-option -g status-right-length 100
|
tmux set-option -g status-right-length 100
|
||||||
tmux set-option -g status-left ""
|
tmux set-option -g status-left ""
|
||||||
tmux set-option -g status-right ""
|
tmux set-option -g status-right ""
|
||||||
|
|
||||||
# message styling
|
|
||||||
tmux set-option -g pane-active-border-style "fg=${blue}"
|
tmux set-option -g pane-active-border-style "fg=${blue}"
|
||||||
tmux set-option -g pane-border-style "fg=${gray}"
|
tmux set-option -g pane-border-style "fg=${gray}"
|
||||||
tmux set-option -g message-style "bg=${gray},fg=${blue}"
|
tmux set-option -g message-style "bg=${gray},fg=${blue}"
|
||||||
|
|
@ -130,34 +115,27 @@ main() {
|
||||||
tmux set-window-option -g window-status-activity-style "bold"
|
tmux set-window-option -g window-status-activity-style "bold"
|
||||||
tmux set-window-option -g window-status-bell-style "bold"
|
tmux set-window-option -g window-status-bell-style "bold"
|
||||||
tmux set-window-option -g window-status-current-style "bold"
|
tmux set-window-option -g window-status-current-style "bold"
|
||||||
# Window option
|
|
||||||
case $show_flags in
|
if $show_flags; then
|
||||||
false)
|
flags="#{?window_flags,#[fg=${light_red}]#{window_flags},}"
|
||||||
flags=""
|
current_flags="#{?window_flags,#[fg=${light_yellow}]#{window_flags},}"
|
||||||
current_flags=""
|
fi
|
||||||
;;
|
|
||||||
true)
|
|
||||||
flags="#{?window_flags,#[fg=${light_purple}]#{window_flags},}"
|
|
||||||
current_flags="#{?window_flags,#[fg=${light_red}]#{window_flags},}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if $show_powerline; then
|
if $show_powerline; then
|
||||||
right_sep="$show_right_sep"
|
right_sep="$show_right_sep"
|
||||||
left_sep="$show_left_sep"
|
left_sep="$show_left_sep"
|
||||||
tmux set-window-option -g window-status-current-format "#[fg=${blue},bg=${gray}]${win_left_sep}#[bg=${blue}]${current_flags}#[fg=${black}] #I:#W #[fg=${blue},bg=${gray}]${win_right_sep}"
|
tmux set-window-option -g window-status-current-format "#[fg=${blue},bg=${gray}]${win_left_sep}#[bg=${blue}]${current_flags}#[fg=${black}] #I:#W #[fg=${blue},bg=${gray}]${win_right_sep}"
|
||||||
tmux set-window-option -g window-status-format "#[fg=${light_gray},bg=${gray}]${win_left_sep}#[bg=${light_gray}]${flags}#[fg=${white}] #I:#W #[fg=${light_gray},bg=${gray}]${win_right_sep}"
|
tmux set-window-option -g window-status-format "#[fg=${light_gray},bg=${gray}]${win_left_sep}#[bg=${light_gray}]${flags}#[fg=${white}] #I:#W #[fg=${light_gray},bg=${gray}]${win_right_sep}"
|
||||||
tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}} ${left_icon} #[fg=${green},bg=${green}]#{?client_prefix,#[fg=${yellow}}${left_sep}"
|
tmux set-option -g status-left "#[bg=${green},fg=${plugin_fg}]#{?client_prefix,#[bg=${yellow}} ${left_icon} #[fg=${green},bg=${green}]#{?client_prefix,#[fg=${yellow}}${left_sep}"
|
||||||
powerbg=${gray}
|
powerbg=${gray}
|
||||||
else
|
else
|
||||||
tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${blue}] #I:#W ${current_flags} "
|
tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${blue}] #I:#W ${current_flags} "
|
||||||
tmux set-window-option -g window-status-format "#[fg=${white},bg=${light_gray}] #I:#W ${flags} "
|
tmux set-window-option -g window-status-format "#[fg=${white},bg=${light_gray}] #I:#W ${flags} "
|
||||||
tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon}"
|
tmux set-option -g status-left "#[bg=${green},fg=${plugin_fg}]#{?client_prefix,#[bg=${yellow}],} ${left_icon}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build_status_bar "left"
|
build_status_bar "left"
|
||||||
build_status_bar "right"
|
build_status_bar "right"
|
||||||
}
|
}
|
||||||
|
|
||||||
# run main function
|
|
||||||
main
|
main
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue