Created
April 14, 2022 09:29
-
-
Save Vulcalien/2ca66ec4e5f33c42c9a53da9a0263b81 to your computer and use it in GitHub Desktop.
Check your battery level on the terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| charge_now=$(cat /sys/class/power_supply/BAT0/charge_now) | |
| charge_full=$(cat /sys/class/power_supply/BAT0/charge_full) | |
| echo $((100 * $charge_now / $charge_full))% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment