How to check for battery percentage on my pc

How can I check for my battery percentage when I have not installed a desktop environment on my arch Linux, what command can be used.

There’s an ‘acpi’ package that will do that from a command line:

$ acpi -b

1 Like

On my Dell laptop, when I used both Arch and Fedora, I could use upower to grab the battery level:

upower -i /org/freedesktop/UPower/devices/battery_BAT0

# or if you want a more simple view

upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state|to\ full|to\ empty|percentage"

There should be a way to just cat things under /sys/class/power_supply/BAT0 and get some info. But the bellow, I haven’t tested myself:

cat /sys/class/power_supply/BAT0/capacity
cat /sys/class/power_supply/BAT0/capacity_level
cat /sys/class/power_supply/BAT0/energy_full
cat /sys/class/power_supply/BAT0/energy_full_design
cat /sys/class/power_supply/BAT0/energy_now
cat /sys/class/power_supply/BAT0/power
cat /sys/class/power_supply/BAT0/power_now
cat /sys/class/power_supply/BAT0/status
cat /sys/class/power_supply/BAT0/voltage_min_design
cat /sys/class/power_supply/BAT0/voltage_now

One of these should show you the battery level. I would assume either status, energy_now or power_now. Other ones would show you total capacity, design and minimum specs. There are more options under there, but those are the ones that sound like it would show what you would like.

By the way, if you don’t want to mess around with the terminal, just install lxqt-powermanagement and run it once you login. This will show you an indicator of your power and charging / discharging state. I’ve used it on LXQt and KDE, then I stopped using it when I moved to sway (the status bar just greps for the upower output automatically).

1 Like

Thank you very much I verified both suggestions and they worked.