mirror of
https://github.com/TECHNOFAB11/tmux2k.git
synced 2025-12-11 23:50:08 +01:00
feat: add icons only option
This commit is contained in:
parent
6a56a82120
commit
c5f9c6ec28
1 changed files with 40 additions and 35 deletions
|
|
@ -15,6 +15,8 @@ wr_sep=$(get_tmux_option "@tmux2k-window-right-sep" )
|
|||
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 rplugins <<<"$(get_tmux_option '@tmux2k-right-plugins' 'battery network time')"
|
||||
theme=$(get_tmux_option "@tmux2k-theme" 'default')
|
||||
icons_only=$(get_tmux_option "@tmux2k-icons-only" false)
|
||||
|
||||
text=$(get_tmux_option "@tmux2k-text" '#282a36')
|
||||
bg_main=$(get_tmux_option "@tmux2k-bg-main" '#15152a')
|
||||
|
|
@ -45,9 +47,20 @@ declare -A plugin_colors=(
|
|||
["time"]="light_blue text"
|
||||
)
|
||||
|
||||
theme=$(get_tmux_option "@tmux2k-theme" 'default')
|
||||
get_plugin_colors() {
|
||||
local plugin_name="$1"
|
||||
local default_colors="${plugin_colors[$plugin_name]}"
|
||||
get_tmux_option "@tmux2k-${plugin_name}-colors" "$default_colors"
|
||||
}
|
||||
|
||||
if [ "$theme" == "catpuccin" ]; then
|
||||
get_plugin_bg() {
|
||||
IFS=' ' read -r -a colors <<<"$(get_plugin_colors "$1")"
|
||||
return "${colors[0]}"
|
||||
}
|
||||
|
||||
set_theme() {
|
||||
case $theme in
|
||||
"catppuccin")
|
||||
bg_main=$(get_tmux_option "@tmux2k-bg-main" '#24273a')
|
||||
bg_alt=$(get_tmux_option "@tmux2k-bg-alt" '#363a4f')
|
||||
black=$(get_tmux_option "@tmux2k-black" '#1e2030')
|
||||
|
|
@ -62,11 +75,12 @@ if [ "$theme" == "catpuccin" ]; then
|
|||
light_yellow=$(get_tmux_option "@tmux2k-light-yellow" '#eed49f')
|
||||
purple=$(get_tmux_option "@tmux2k-purple" '#c6a0f6')
|
||||
light_purple=$(get_tmux_option "@tmux2k-light-purple" '#f5bde6')
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$theme" == "icons" ]; then
|
||||
if $icons_only; then
|
||||
text=$bg_main
|
||||
declare -A plugin_colors=(
|
||||
plugin_colors=(
|
||||
["git"]="text green"
|
||||
["cpu"]="text blue"
|
||||
["ram"]="text light_yellow"
|
||||
|
|
@ -79,16 +93,6 @@ if [ "$theme" == "icons" ]; then
|
|||
["time"]="text light_blue"
|
||||
)
|
||||
fi
|
||||
|
||||
get_plugin_colors() {
|
||||
local plugin_name="$1"
|
||||
local default_colors="${plugin_colors[$plugin_name]}"
|
||||
get_tmux_option "@tmux2k-${plugin_name}-colors" "$default_colors"
|
||||
}
|
||||
|
||||
get_plugin_bg() {
|
||||
IFS=' ' read -r -a colors <<<"$(get_plugin_colors "$1")"
|
||||
return "${colors[0]}"
|
||||
}
|
||||
|
||||
set_options() {
|
||||
|
|
@ -179,6 +183,7 @@ window_list() {
|
|||
}
|
||||
|
||||
main() {
|
||||
set_theme
|
||||
set_options
|
||||
start_icon
|
||||
status_bar "left"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue