mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
plugins/battery: Refactor extraction of percentage without a non-POSIX option
This commit is contained in:
@@ -61,7 +61,7 @@ battery_percentage(){
|
||||
|
||||
if command_exists upower;
|
||||
then
|
||||
local UPOWER_OUTPUT=$(_omb_plugin_battery__upower_print_info | grep percentage | tail --bytes 5)
|
||||
local UPOWER_OUTPUT=$(_omb_plugin_battery__upower_print_info | sed -n 's/.*percentage[:[:blank:]]*\([0-9%]\{1,\}\)$/\1/p')
|
||||
echo ${UPOWER_OUTPUT: : -1}
|
||||
elif command_exists acpi;
|
||||
then
|
||||
|
||||
Reference in New Issue
Block a user