feat: add icons theme

This commit is contained in:
Abhishek Keshri 2024-03-26 15:40:35 +05:30 committed by Abhishek Keshri
parent 72a9f033cb
commit 6a56a82120

View file

@ -32,6 +32,19 @@ light_yellow=$(get_tmux_option "@tmux2k-light-yellow" '#ffd21a')
purple=$(get_tmux_option "@tmux2k-purple" '#bf58ff') purple=$(get_tmux_option "@tmux2k-purple" '#bf58ff')
light_purple=$(get_tmux_option "@tmux2k-light-purple" '#ff65c6') light_purple=$(get_tmux_option "@tmux2k-light-purple" '#ff65c6')
declare -A plugin_colors=(
["git"]="green text"
["cpu"]="blue text"
["ram"]="light_yellow text"
["gpu"]="yellow text"
["battery"]="light_purple text"
["network"]="purple text"
["bandwidth"]="purple text"
["ping"]="purple text"
["weather"]="yellow text"
["time"]="light_blue text"
)
theme=$(get_tmux_option "@tmux2k-theme" 'default') theme=$(get_tmux_option "@tmux2k-theme" 'default')
if [ "$theme" == "catpuccin" ]; then if [ "$theme" == "catpuccin" ]; then
@ -51,18 +64,21 @@ if [ "$theme" == "catpuccin" ]; then
light_purple=$(get_tmux_option "@tmux2k-light-purple" '#f5bde6') light_purple=$(get_tmux_option "@tmux2k-light-purple" '#f5bde6')
fi fi
if [ "$theme" == "icons" ]; then
text=$bg_main
declare -A plugin_colors=( declare -A plugin_colors=(
["git"]="green text" ["git"]="text green"
["cpu"]="blue text" ["cpu"]="text blue"
["ram"]="light_yellow text" ["ram"]="text light_yellow"
["gpu"]="yellow text" ["gpu"]="text yellow"
["battery"]="light_purple text" ["battery"]="text light_purple"
["network"]="purple text" ["network"]="text purple"
["bandwidth"]="purple text" ["bandwidth"]="text purple"
["ping"]="purple text" ["ping"]="text purple"
["weather"]="yellow text" ["weather"]="text yellow"
["time"]="light_blue text" ["time"]="text light_blue"
) )
fi
get_plugin_colors() { get_plugin_colors() {
local plugin_name="$1" local plugin_name="$1"
@ -101,7 +117,7 @@ start_icon() {
first_plugin=${lplugins[0]} first_plugin=${lplugins[0]}
IFS=' ' read -r -a first_colors <<<"$(get_plugin_colors "$first_plugin")" IFS=' ' read -r -a first_colors <<<"$(get_plugin_colors "$first_plugin")"
tmux set-option -g status-left "#[bg=${!first_colors[0]},fg=${text}]#{?client_prefix,#[bg=${light_yellow},} ${start_icon} " tmux set-option -g status-left "#[bg=${!first_colors[0]},fg=${!first_colors[1]}]#{?client_prefix,#[bg=${light_yellow},} ${start_icon} "
} }
status_bar() { status_bar() {