Cleanup shellcheck warnings (#178)
* chore: shellcheck-warnings for catppuccin.tmux Command used: `shellcheck catppuccin.tmux -ax -s bash` * shellcheck: fix all warnings Command used: `shellcheck -a catppuccin.tmux $(ls custom/*.sh pane/*.sh status/*.sh window/*.sh)` * shellcheck: update workflow to check warnings * shellcheck: include warnings from sourced files
This commit is contained in:
parent
a1079943b6
commit
61727758ac
22 changed files with 193 additions and 139 deletions
|
@ -1,10 +1,12 @@
|
|||
show_application() {
|
||||
local index=$1
|
||||
local icon=$(get_tmux_option "@catppuccin_application_icon" "")
|
||||
local color=$(get_tmux_option "@catppuccin_application_color" "$thm_pink")
|
||||
local text=$(get_tmux_option "@catppuccin_application_text" "#W")
|
||||
local index icon color text module
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
index=$1
|
||||
icon=$(get_tmux_option "@catppuccin_application_icon" "")
|
||||
color=$(get_tmux_option "@catppuccin_application_color" "$thm_pink")
|
||||
text=$(get_tmux_option "@catppuccin_application_text" "#W")
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
show_battery() {
|
||||
local index icon color text module
|
||||
|
||||
index=$1
|
||||
icon=$(get_tmux_option "@catppuccin_battery_icon" "#{battery_icon}")
|
||||
color=$(get_tmux_option "@catppuccin_battery_color" "$thm_yellow")
|
||||
text=$(get_tmux_option "@catppuccin_battery_text" "#{battery_percentage}")
|
||||
|
||||
tmux set-option -g @batt_icon_charge_tier8 ''
|
||||
tmux set-option -g @batt_icon_charge_tier7 ''
|
||||
tmux set-option -g @batt_icon_charge_tier6 ''
|
||||
|
@ -12,12 +19,7 @@ show_battery() {
|
|||
tmux set-option -g @batt_icon_status_discharging ''
|
||||
tmux set-option -g @batt_icon_status_unknown ''
|
||||
|
||||
local index=$1
|
||||
local icon=$(get_tmux_option "@catppuccin_battery_icon" "#{battery_icon}")
|
||||
local color=$(get_tmux_option "@catppuccin_battery_color" "$thm_yellow")
|
||||
local text=$(get_tmux_option "@catppuccin_battery_text" "#{battery_percentage}")
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
# Requires https://github.com/vascomfnunes/tmux-clima
|
||||
show_clima() {
|
||||
local index=$1
|
||||
local icon="$(get_tmux_option "@catppuccin_clima_icon" "")"
|
||||
local color="$(get_tmux_option "@catppuccin_clima_color" "$thm_yellow")"
|
||||
local text="$(get_tmux_option "@catppuccin_clima_text" "#{clima}")"
|
||||
local index icon color text module
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
index=$1
|
||||
icon="$(get_tmux_option "@catppuccin_clima_icon" "")"
|
||||
color="$(get_tmux_option "@catppuccin_clima_color" "$thm_yellow")"
|
||||
text="$(get_tmux_option "@catppuccin_clima_text" "#{clima}")"
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
show_cpu() {
|
||||
tmux set-option -g @cpu_low_bg_color "$thm_yellow" # background color when cpu is low
|
||||
tmux set-option -g @cpu_medium_bg_color "$thm_orange" # background color when cpu is medium
|
||||
tmux set-option -g @cpu_high_bg_color "$thm_red" # background color when cpu is high
|
||||
|
||||
local index=$1
|
||||
local icon=$(get_tmux_option "@catppuccin_cpu_icon" "")
|
||||
local color="$(get_tmux_option "@catppuccin_cpu_color" "#{cpu_bg_color}")"
|
||||
local text="$(get_tmux_option "@catppuccin_cpu_text" "#{cpu_percentage}")"
|
||||
local index icon color text module
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
index=$1
|
||||
icon=$(get_tmux_option "@catppuccin_cpu_icon" "")
|
||||
color="$(get_tmux_option "@catppuccin_cpu_color" "#{cpu_bg_color}")"
|
||||
text="$(get_tmux_option "@catppuccin_cpu_text" "#{cpu_percentage}")"
|
||||
|
||||
tmux set-option -g @cpu_low_bg_color "$thm_yellow" # background color when cpu is low
|
||||
tmux set-option -g @cpu_medium_bg_color "$thm_orange" # background color when cpu is medium
|
||||
tmux set-option -g @cpu_high_bg_color "$thm_red" # background color when cpu is high
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
show_date_time() {
|
||||
local index=$1
|
||||
local icon="$(get_tmux_option "@catppuccin_date_time_icon" "")"
|
||||
local color="$(get_tmux_option "@catppuccin_date_time_color" "$thm_blue")"
|
||||
local text="$(get_tmux_option "@catppuccin_date_time_text" "%Y-%m-%d %H:%M")"
|
||||
local index icon color text module
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
index=$1
|
||||
icon="$(get_tmux_option "@catppuccin_date_time_icon" "")"
|
||||
color="$(get_tmux_option "@catppuccin_date_time_color" "$thm_blue")"
|
||||
text="$(get_tmux_option "@catppuccin_date_time_text" "%Y-%m-%d %H:%M")"
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
show_directory() {
|
||||
local index=$1
|
||||
local icon=$(get_tmux_option "@catppuccin_directory_icon" "")
|
||||
local color=$(get_tmux_option "@catppuccin_directory_color" "$thm_pink")
|
||||
local text=$(get_tmux_option "@catppuccin_directory_text" "#{b:pane_current_path}")
|
||||
local index icon color text module
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
index=$1
|
||||
icon=$(get_tmux_option "@catppuccin_directory_icon" "")
|
||||
color=$(get_tmux_option "@catppuccin_directory_color" "$thm_pink")
|
||||
text=$(get_tmux_option "@catppuccin_directory_text" "#{b:pane_current_path}")
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
show_host() {
|
||||
local index=$1
|
||||
local icon=$(get_tmux_option "@catppuccin_host_icon" "")
|
||||
local color=$(get_tmux_option "@catppuccin_host_color" "$thm_magenta")
|
||||
local text=$(get_tmux_option "@catppuccin_host_text" "#H")
|
||||
local index icon color text module
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
index=$1
|
||||
icon=$(get_tmux_option "@catppuccin_host_icon" "")
|
||||
color=$(get_tmux_option "@catppuccin_host_color" "$thm_magenta")
|
||||
text=$(get_tmux_option "@catppuccin_host_text" "#H")
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
show_load() {
|
||||
local index=$1
|
||||
local icon="$(get_tmux_option "@catppuccin_load_icon" "")"
|
||||
local color="$(get_tmux_option "@catppuccin_load_color" "$thm_blue")"
|
||||
local text="$(get_tmux_option "@catppuccin_load_text" "#{load_full}")"
|
||||
local index icon color text module
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
index=$1
|
||||
icon="$(get_tmux_option "@catppuccin_load_icon" "")"
|
||||
color="$(get_tmux_option "@catppuccin_load_color" "$thm_blue")"
|
||||
text="$(get_tmux_option "@catppuccin_load_text" "#{load_full}")"
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
show_session() {
|
||||
local index=$1
|
||||
local icon=$(get_tmux_option "@catppuccin_session_icon" "")
|
||||
local color=$(get_tmux_option "@catppuccin_session_color" "#{?client_prefix,$thm_red,$thm_green}")
|
||||
local text=$(get_tmux_option "@catppuccin_session_text" "#S")
|
||||
local index icon color text module
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
index=$1
|
||||
icon=$(get_tmux_option "@catppuccin_session_icon" "")
|
||||
color=$(get_tmux_option "@catppuccin_session_color" "#{?client_prefix,$thm_red,$thm_green}")
|
||||
text=$(get_tmux_option "@catppuccin_session_text" "#S")
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
show_uptime() {
|
||||
local index=$1
|
||||
local icon="$(get_tmux_option "@catppuccin_uptime_icon" "")"
|
||||
local color="$(get_tmux_option "@catppuccin_uptime_color" "$thm_green")"
|
||||
local text="$(get_tmux_option "@catppuccin_uptime_text" "#(uptime | sed 's/^[^,]*up *//; s/, *[[:digit:]]* users.*//; s/ day.*, */d /; s/:/h /; s/ min//; s/$/m/')")"
|
||||
local index icon color text module
|
||||
|
||||
local module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
index=$1
|
||||
icon="$(get_tmux_option "@catppuccin_uptime_icon" "")"
|
||||
color="$(get_tmux_option "@catppuccin_uptime_color" "$thm_green")"
|
||||
text="$(get_tmux_option "@catppuccin_uptime_text" "#(uptime | sed 's/^[^,]*up *//; s/, *[[:digit:]]* users.*//; s/ day.*, */d /; s/:/h /; s/ min//; s/$/m/')")"
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
show_user() {
|
||||
local index=$1
|
||||
local icon=$(get_tmux_option "@catppuccin_user_icon" "")
|
||||
local color=$(get_tmux_option "@catppuccin_user_color" "$thm_cyan")
|
||||
local text=$(get_tmux_option "@catppuccin_user_text" "#(whoami)")
|
||||
local index icon color text module
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
index=$1
|
||||
icon=$(get_tmux_option "@catppuccin_user_icon" "")
|
||||
color=$(get_tmux_option "@catppuccin_user_color" "$thm_cyan")
|
||||
text=$(get_tmux_option "@catppuccin_user_text" "#(whoami)")
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
# Requires https://github.com/xamut/tmux-weather.
|
||||
show_weather() {
|
||||
local index=$1
|
||||
local icon="$(get_tmux_option "@catppuccin_weather_icon" "")"
|
||||
local color="$(get_tmux_option "@catppuccin_weather_color" "$thm_yellow")"
|
||||
local text="$(get_tmux_option "@catppuccin_weather_text" "#{weather}")"
|
||||
|
||||
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
|
||||
show_weather() {
|
||||
local index icon color text module
|
||||
|
||||
index=$1
|
||||
icon="$(get_tmux_option "@catppuccin_weather_icon" "")"
|
||||
color="$(get_tmux_option "@catppuccin_weather_color" "$thm_yellow")"
|
||||
text="$(get_tmux_option "@catppuccin_weather_text" "#{weather}")"
|
||||
|
||||
module=$(build_status_module "$index" "$icon" "$color" "$text")
|
||||
|
||||
echo "$module"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue