You are not logged in.
What I ultimately want to do is to get the backup UPC (Uninterruptible Power Supply) info (specifically UPC battery charge status) on to i3 status bar. In the case of laptops, i3 status bar takes laptop's battery info from /sys/class/power_supply directory, where you can see BATX files. My UPC is connected to my computer via USB, so there must be somewhere I can get this info. I am currently using apcupsd to look at the battery charge status, etc., but I would like to put those info in my i3 status bar. Does anyone know if this is possible?
Thanks.
Last edited by redshoe (2024-03-21 14:30:31)
Offline
See here: https://askubuntu.com/questions/69556/h … e-terminal and read 'man i3status', especially "battery 0 {", "Battery" and "EXTERNAL SCRIPTS/PROGRAMS WITH I3STATUS".
'upower -e' enumerates path to devices. I don't know what format returns '/sys/class/power_supply/BAT%d/uevent', because I don't have that path, is it similar to what returns 'upower -d' or 'upower -i $(upower -e)'. If not then you need create your own script for i3status (man i3status: "EXTERNAL SCRIPTS/PROGRAMS WITH I3STATUS").
Offline
Thank you for the reply, but the solution that you have linked is based on the fact that I could get something from '/sys/class/power_supply/BAT%d/uevent' or some sort. But, like how I described above, I don't have that in my '/sys/class/power_supply', just like you don't have that path.
Offline
If your UPS is connected to USB then what returns commands:
lsusb
upower -e
upower -d
upower -i $(upower -e)If 'upower -e' works and returns path then try to use it instead of '/sys/class/power_supply/...' path.
Offline
Thanks! upower does return some decent info, and I was able to get some info from /sys/devices/pci0000:00/0000:00:08.1/0000:0c:00.3/usb3/3-1/3-1:1.0/usbmisc/hiddev0. Thank you!
Offline