You are not logged in.
Pages: 1
I'm running TDE on Q4OS on my Pinebook 1080p.
I would like to add a battery monitor to my conky.
I have tried ${battery BAT0} and ${battery BAT1}, but neither produce any display.
What am I missing?
Offline
Can you check if you have the right info on your system? you could try this command and it should give you the current percentage of your battery
cat /sys/class/power_supply/BAT0/capacity
This should simply output a number between 0 and 100 (the percentage of battery remaining).
If you get a "No such file or directory" error could you post her the output of
ls /sys/class/power_supply/
Offline
Thank you for the reply, @Dai_trying.
That command does output the same percent as the little widget on the panel.
I have used it in a script on the top line of my conky:
${exec /.battery_percent}%
I'd prefer a built-in conky command and a bar graph if possible.
adminq@pinebook1080p:~$ ls /sys/class/power_supply/
ac battery usb
adminq@pinebook1080p:~$
Last edited by jschall (2018-11-19 13:12)
Offline
can you start the conky from the command line using your custom file (if necessary) using ${battery BAT0} so we can see if any error is output
conky -c .my_conkyrc
replacing .my_conkyrc with your custom file (if used)
or if you are using .conkyrc in your home folder simply issuing conky as a command would have the same effect.
please post any output
Offline
Do you mean:
------------------------------------------------------------
adminq@pinebook1080p:~$ conky&
[1] 20708
adminq@pinebook1080p:~$ conky: desktop window (1200016) is subwindow of root window (25d)
conky: window type - normal
conky: drawing to created window (0x3800002)
conky: drawing to double buffer
*** Error in `conky': corrupted size vs. prev_size: 0x000000558dafec70 ***
---------------------------------------------------------------------------------------------------------
Offline
I have requested your wifilevel script in the other post but I think the problem is the same here, comment out the wifilevel script and put ${battery BAT0} in place of your battery level script to see if that works.
Offline
Thanks for looking into my problem, @Dai_trying.
Here is what happens when I replace ${exec ./batt_percent} with ${battery BAT0}:
adminq@pinebook1080p:~$ killall conky
adminq@pinebook1080p:~$ conky&
[1] 22726
adminq@pinebook1080p:~$ conky: desktop window (1200016) is subwindow of root window (25d)
conky: window type - normal
conky: drawing to created window (0x3800002)
conky: drawing to double buffer
conky: can't open /sys/class/power_supply/BAT0/uevent: No such file or directory
conky: can't open /proc/acpi/battery/BAT0/state: No such file or directory
conky: can't open /proc/apm: No such file or directory
*** Error in `conky': corrupted size vs. prev_size: 0x000000557271c6d0 ***
^C
[1]+ Aborted conky
adminq@pinebook1080p:~$
Offline
do you get information when using the following command?
cat /sys/class/power_supply/BAT0/uevent
If not could you post the output of
ls -l /sys/class/power_supply/BAT0/
Offline
Here ya go:
adminq@pinebook1080p:~$ cat /sys/class/power_supply/BAT0/uevent
cat: /sys/class/power_supply/BAT0/uevent: No such file or directory
adminq@pinebook1080p:~$
adminq@pinebook1080p:~$ ls -l /sys/class/power_supply/BAT0/
ls: cannot access '/sys/class/power_supply/BAT0/': No such file or directory
adminq@pinebook1080p:~$ ^C
adminq@pinebook1080p:~$
I really appreciate your help, @Dai_trying.
Offline
This doesn't make sense, your reply in post #3 says you issued the command cat /sys/class/power_supply/BAT0/capacity and it produced an output matching your toolbar display but now the same path is not available...???...
it seems you did not execute the command exactly as I posted it but adapted it...
double checking that post you showed the battery listed as battery and not BAT0, maybe you could use ${battery battery} in your conky but I don't know if that will work but it should...
Last edited by Dai_trying (2018-11-19 22:48)
Offline
This is the script that works:
#!/bin/sh
cat /sys/class/power_supply/battery/capacity
So, it seems that "battery" has replaced "BAT0" everywhere?
Offline
yes it looks that way, did you try it in conky? and did it work?
Offline
Well, ${battery battery} sort of works. It gives a weird negative percent.
But my conky still keeps crashing, as you can see in the screenshot.
Offline
This is definitely a bit weird... unfortunately I do not have any similar hardware to be able to test so not sure I can offer any more advice really...
One thing you could try is to comment out all lines in the text section and then un-comment 1 line at a time to see where the problem starts, this is what I would do to narrow down where any problem(s) is (are).
Offline
I finally have a workaround that displays the battery percentage and status in Conkyon my Pinebook.
I use the shell commands in script files:
#!/bin/sh
cat /sys/class/power_supply/battery/capacity
and
#!/bin/sh
cat /sys/class/power_supply/battery/status
and I just use two ${exec ./ } commands on a line in .conkyrc
It may not be elegant, but it works.
Offline
Pages: 1