mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
* Simplified battery percentage retrieval command Simplified the battery percentage extraction command. * Used int instead of adding 0, put exit back in Changed to use int. Put exit back in to only return first battery in case of systems with multiple batteries.
10 lines
230 B
Bash
Executable File
10 lines
230 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Returns the battery percentage remaining as an integer.
|
|
# Used by the battery monitor and the Ctrl + Shift + Super + B hotkey.
|
|
|
|
upower -i $(upower -e | grep BAT) | awk '/percentage/ {
|
|
print int($2)
|
|
exit
|
|
}'
|