Files
dotfiles/.local/bin/station-battery-remaining

10 lines
230 B
Plaintext
Raw Normal View History

2026-03-06 23:42:56 +00:00
#!/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
}'