Skip to content

Commit 281b8c2

Browse files
committed
address coderabbit comment
1 parent c9fa47b commit 281b8c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/battery.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ main()
175175
if [ -z "$bat_perc" ]; then # In case it is a desktop with no battery percent, only AC power
176176
echo "$no_bat_label"
177177
elif [ -z "$bat_stat" ]; then # Test if status is empty or not
178-
echo "$bat_label $bat_perc"
178+
# Only add a space when label is not empty
179+
if [ -n "$bat_label" ]; then
180+
echo "$bat_label $bat_perc"
181+
else
182+
echo "$bat_perc"
183+
fi
179184
else
180185
echo "$bat_label$bat_stat $bat_perc"
181186
fi

0 commit comments

Comments
 (0)