Skip to content

Instantly share code, notes, and snippets.

@renegarcia
Last active July 28, 2023 17:26
Show Gist options
  • Save renegarcia/09e983be8da8db85308e6c7f740dcf2c to your computer and use it in GitHub Desktop.
Save renegarcia/09e983be8da8db85308e6c7f740dcf2c to your computer and use it in GitHub Desktop.
Show battery status cli
#!/usr/bin/bash
upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state|to full| percentage"
@renegarcia
Copy link
Author

renegarcia commented Jul 28, 2023

If using fish shell, you can also add as an abbrevation (alias) in your config.fish file like so:

abbr -a -- bat 'upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state|to full| percentage"'

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment