We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c52d4f commit 48fae59Copy full SHA for 48fae59
.gitignore
@@ -0,0 +1 @@
1
+*.swp
scripts/battery_remain.sh
@@ -106,7 +106,11 @@ upower_battery_remaining_time() {
106
}
107
108
acpi_battery_remaining_time() {
109
- acpi -b | grep -m 1 -Eo "[0-9]+:[0-9]+:[0-9]+"
+ regex="[0-9]+:[0-9]+"
110
+ if ! $short; then
111
+ regex="$regex:[0-9]+"
112
+ fi
113
+ acpi -b | grep -m 1 -Eo "$regex"
114
115
116
print_battery_remain() {
0 commit comments