Merge pull request #139 from alecho/battery-label

Add battery icon option
This commit is contained in:
Ethan Edwards 2021-10-30 02:25:54 -04:00 committed by GitHub
commit 78869c38cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,15 +108,16 @@ battery_status()
main()
{
bat_label=$(get_tmux_option "@dracula-battery-label" "♥")
bat_stat=$(battery_status)
bat_perc=$(battery_percent)
if [ -z "$bat_stat" ]; then # Test if status is empty or not
echo " $bat_perc"
echo "$bat_label $bat_perc"
elif [ -z "$bat_perc" ]; then # In case it is a desktop with no battery percent, only AC power
echo " $bat_stat"
echo "$bat_label $bat_stat"
else
echo " $bat_stat $bat_perc"
echo "$bat_label $bat_stat $bat_perc"
fi
}