dnschneid / crouton

Chromium OS Universal Chroot Environment
https://goo.gl/fd3zc?si=1
BSD 3-Clause "New" or "Revised" License
8.57k stars 1.24k forks source link

View battery level in chroot - ARM Chromebook #71

Closed ghost closed 11 years ago

ghost commented 11 years ago

Is it possible to get the battery level within the chroot? I've had a few near-misses where I don't know how much battery is left when working in the chroot.

DennisLfromGA commented 11 years ago

After reading your question I did a brief search and found a couple of possibilities -

The second article also shows a GUI tool that might work too - based on gnome. I have an Acer C7 with crouton installed so I'll try these out as soon as I get a chance and report back...

dnschneid commented 11 years ago

If you're using xfce, you can add the battery plugin to your panel. xfce4-power-manager should also work without any bad side effects (as long as you disable auto-suspend and whatnot).

akobel commented 11 years ago

You can use upower to get the information on the console. upower -e (as root) to show the available power-related devices, then upower -i <device-path> to get a summary of the information about it. On my Samsung Exynos5, this is upower -i /org/freedesktop/UPower/devices/battery_sbs_4_000b.

You can also have a look at the (raw) data in /sys/class/power_supply/<device>/uevent, which AFAICS summarizes all information in the other pseudo-files of the directory. Nice thing: you can easily use this in shell scripts by issuing eval $(cat /sys/class/power_supply/<device>/uevent, which loads everything in shell variables.

tedm commented 11 years ago

on the arm, with xfce desktop (precise), the toolbar battery monitor upon launch is about 3% lower than chromeos, and seems to stay at where it is when launched.

for time, there is a 10 digit constant (8:2) that doesn't seem to map to seconds.