Merge pull request #139 from alecho/battery-label
Add battery icon option
This commit is contained in:
commit
78869c38cc
1 changed files with 4 additions and 3 deletions
|
@ -108,15 +108,16 @@ battery_status()
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
bat_label=$(get_tmux_option "@dracula-battery-label" "♥")
|
||||||
bat_stat=$(battery_status)
|
bat_stat=$(battery_status)
|
||||||
bat_perc=$(battery_percent)
|
bat_perc=$(battery_percent)
|
||||||
|
|
||||||
if [ -z "$bat_stat" ]; then # Test if status is empty or not
|
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
|
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
|
else
|
||||||
echo "♥ $bat_stat $bat_perc"
|
echo "$bat_label $bat_stat $bat_perc"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue