Display CPU label on CPU load configuration

Change to display the defined value of "dracula-cpu-usage-label" (e.g. CPU) when load average is used instead percentage.
Before this change the label was not displayed if CPU load average is used.
This commit is contained in:
tarantila 2022-08-31 14:12:26 +02:00 committed by GitHub
parent 150daf31e1
commit 731114654d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,10 +44,10 @@ main() {
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
cpu_load=$(get_tmux_option "@dracula-cpu-display-load" false)
cpu_label=$(get_tmux_option "@dracula-cpu-usage-label" "CPU")
if [ "$cpu_load" = true ]; then
echo "$(get_load)"
echo "$cpu_label $(get_load)"
else
cpu_label=$(get_tmux_option "@dracula-cpu-usage-label" "CPU")
cpu_percent=$(get_percent)
echo "$cpu_label $cpu_percent"
fi