The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

i3status battery problem

asked 2013-05-17 13:09:57 +0000

sloan gravatar image

Hey dear users of i3 :)

I'm quite new using i3. I started about 2 months ago after 2 years of openbox.

It's awesome... But i still have something annoying.

Here is my problem :

I'm using a x121e AMD-450 laptop. Which of course have a battery... But can't configure properly my i3status bar to display information about battery.

I tried to swithc my i3status.conf with :

battery 1 { format = "%status %percentage %remaining %emptytime" path = "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT1/uevent" }

Which doesnt work neither, while the path seems to be good...

/sys/class/power_supply % ll

lrwxrwxrwx 1 root root 0 mai 17 14:50 ACAD> ../../devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0003:00/powersupply/ACAD/ lrwxrwxrwx 1 root root 0 mai 17 14:50 BAT1 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/powersupply/BAT1/

Any idea?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-05-18 04:19:32 +0000

panth0r gravatar image

Assuming you're configuring the path to the correct value, do the colon characters (':') require escaping (accomplished by preceding them with a '\') such that

battery 1 { format = "%status %percentage %remaining %emptytime" path = "/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT1/uevent" }

becomes

battery 1 { format = "%status %percentage %remaining %emptytime" path = "/sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/PNP0C0A\:00/power_supply/BAT1/uevent" }

?

The following is the output generated when I run "cat /sys/class/power_supply/BAT0/uevent":

POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=14400000
POWER_SUPPLY_VOLTAGE_NOW=16521000
POWER_SUPPLY_POWER_NOW=27738000
POWER_SUPPLY_ENERGY_FULL_DESIGN=74880000
POWER_SUPPLY_ENERGY_FULL=48400000
POWER_SUPPLY_ENERGY_NOW=14110000
POWER_SUPPLY_CAPACITY=29
POWER_SUPPLY_MODEL_NAME=42T4571
POWER_SUPPLY_MANUFACTURER=SONY
POWER_SUPPLY_SERIAL_NUMBER= 6295

You may wish to run "cat /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/PNP0C0A\:00/power_supply/BAT1/uevent" (at least Bash requires ':'s be escaped) and compare the result to the one above to verify you're proving the correct path (and one i3status can correctly parse).

I'm on an X61, which fortunately uses the "standard path," but wish I could test this suggestion more thoroughly.

Don't know how much it'll help, but it's always nice to be able to drop down to the code... to which I can't post a link.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-05-17 13:09:57 +0000

Seen: 771 times

Last updated: May 18 '13