Merge pull request #176 from aaronkollasch/reject-unknown-plugins

Reject unrecognized plugins in config
This commit is contained in:
Ethan Edwards 2023-04-08 14:27:56 -04:00 committed by GitHub
commit eda8c62139
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,61 +132,51 @@ main()
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-cwd-colors" "dark_gray white") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-cwd-colors" "dark_gray white")
tmux set-option -g status-right-length 250 tmux set-option -g status-right-length 250
script="#($current_dir/cwd.sh)" script="#($current_dir/cwd.sh)"
fi
if [ $plugin = "git" ]; then elif [ $plugin = "git" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-git-colors" "green dark_gray") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-git-colors" "green dark_gray")
tmux set-option -g status-right-length 250 tmux set-option -g status-right-length 250
script="#($current_dir/git.sh)" script="#($current_dir/git.sh)"
fi
if [ $plugin = "battery" ]; then elif [ $plugin = "battery" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-battery-colors" "pink dark_gray") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-battery-colors" "pink dark_gray")
script="#($current_dir/battery.sh)" script="#($current_dir/battery.sh)"
fi
if [ $plugin = "gpu-usage" ]; then elif [ $plugin = "gpu-usage" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-gpu-usage-colors" "pink dark_gray") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-gpu-usage-colors" "pink dark_gray")
script="#($current_dir/gpu_usage.sh)" script="#($current_dir/gpu_usage.sh)"
fi
if [ $plugin = "cpu-usage" ]; then elif [ $plugin = "cpu-usage" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-cpu-usage-colors" "orange dark_gray") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-cpu-usage-colors" "orange dark_gray")
script="#($current_dir/cpu_info.sh)" script="#($current_dir/cpu_info.sh)"
fi
if [ $plugin = "ram-usage" ]; then elif [ $plugin = "ram-usage" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-ram-usage-colors" "cyan dark_gray") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-ram-usage-colors" "cyan dark_gray")
script="#($current_dir/ram_info.sh)" script="#($current_dir/ram_info.sh)"
fi
if [ $plugin = "network" ]; then elif [ $plugin = "network" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-network-colors" "cyan dark_gray") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-network-colors" "cyan dark_gray")
script="#($current_dir/network.sh)" script="#($current_dir/network.sh)"
fi
if [ $plugin = "network-bandwidth" ]; then elif [ $plugin = "network-bandwidth" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-network-bandwidth-colors" "cyan dark_gray") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-network-bandwidth-colors" "cyan dark_gray")
tmux set-option -g status-right-length 250 tmux set-option -g status-right-length 250
script="#($current_dir/network_bandwidth.sh)" script="#($current_dir/network_bandwidth.sh)"
fi
if [ $plugin = "network-ping" ]; then elif [ $plugin = "network-ping" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-network-ping-colors" "cyan dark_gray") IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-network-ping-colors" "cyan dark_gray")
script="#($current_dir/network_ping.sh)" script="#($current_dir/network_ping.sh)"
fi
if [ $plugin = "spotify-tui" ]; then elif [ $plugin = "spotify-tui" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-spotify-tui-colors" "green dark_gray") IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-spotify-tui-colors" "green dark_gray")
script="#($current_dir/spotify-tui.sh)" script="#($current_dir/spotify-tui.sh)"
fi
if [ $plugin = "kubernetes-context" ]; then elif [ $plugin = "kubernetes-context" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-kubernetes-context-colors" "cyan dark_gray") IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-kubernetes-context-colors" "cyan dark_gray")
script="#($current_dir/kubernetes_context.sh $show_kubernetes_context_label)" script="#($current_dir/kubernetes_context.sh $show_kubernetes_context_label)"
fi
if [ $plugin = "weather" ]; then elif [ $plugin = "weather" ]; then
# wait unit $datafile exists just to avoid errors # wait unit $datafile exists just to avoid errors
# this should almost never need to wait unless something unexpected occurs # this should almost never need to wait unless something unexpected occurs
while [ ! -f $datafile ]; do while [ ! -f $datafile ]; do
@ -195,9 +185,8 @@ main()
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-weather-colors" "orange dark_gray") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-weather-colors" "orange dark_gray")
script="#(cat $datafile)" script="#(cat $datafile)"
fi
if [ $plugin = "time" ]; then elif [ $plugin = "time" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-time-colors" "dark_purple white") IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-time-colors" "dark_purple white")
if $show_day_month && $show_military ; then # military time and dd/mm if $show_day_month && $show_military ; then # military time and dd/mm
script="%a %d/%m %R ${timezone} " script="%a %d/%m %R ${timezone} "
@ -208,6 +197,9 @@ main()
else else
script="%a %m/%d %I:%M %p ${timezone} " script="%a %m/%d %I:%M %p ${timezone} "
fi fi
else
continue
fi fi
if $show_powerline; then if $show_powerline; then