mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
plugins/battery: Fix an error message on no battery systems
This commit is contained in:
@@ -62,7 +62,8 @@ battery_percentage(){
|
|||||||
if command_exists upower;
|
if command_exists upower;
|
||||||
then
|
then
|
||||||
local UPOWER_OUTPUT=$(_omb_plugin_battery__upower_print_info | sed -n 's/.*percentage[:[:blank:]]*\([0-9%]\{1,\}\)$/\1/p')
|
local UPOWER_OUTPUT=$(_omb_plugin_battery__upower_print_info | sed -n 's/.*percentage[:[:blank:]]*\([0-9%]\{1,\}\)$/\1/p')
|
||||||
echo ${UPOWER_OUTPUT: : -1}
|
[[ $UPOWER_OUTPUT ]] &&
|
||||||
|
echo "${UPOWER_OUTPUT::-1}"
|
||||||
elif command_exists acpi;
|
elif command_exists acpi;
|
||||||
then
|
then
|
||||||
local ACPI_OUTPUT=$(acpi -b)
|
local ACPI_OUTPUT=$(acpi -b)
|
||||||
|
Reference in New Issue
Block a user