Prompt.bash : Verify if acpi command exists to avoid error message.
This commit is contained in:
parent
24ccf4783c
commit
b6a26d4df1
1 changed files with 1 additions and 0 deletions
|
|
@ -159,6 +159,7 @@ git_branch_color()
|
|||
# Get the battery status in percent
|
||||
battery()
|
||||
{
|
||||
command -v acpi >/dev/null 2>&1 || { echo -n ""; return; }
|
||||
bat=`acpi --battery | sed "s/^Battery .*, \([0-9]*\)%.*$/\1/"`
|
||||
if [ ${bat} -lt 90 ] ; then
|
||||
echo -n " ${bat}%"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue