Battery level goes wrong in i3

49 views
Skip to first unread message

themastero...@gmail.com

unread,
Feb 18, 2017, 3:51:51 PM2/18/17
to qubes-devel
Hello Everyone,

I was giving a look at /bin/qubes-i3status and realized that it is supposed to show also battery info in the statusbar along with disk usage, time and so on. This does not happen for me. The reason is that at some point the script looks for /sys/class/power_supply/BAT*/energy_now and /sys/class/power_supply/BAT*/energy_full to calculate the charge percentage of the battery. Unfortunately, energy_now and energy_full are not present in /sys/class/power_supply/BAT* for me. I tried to edit the script using instead charge_now and charge_full. Doing this, the battery information is correctly displayed when AC is disconnected, but when it's not it balloons up to 137%. This is not a problem of the script itself but of the charge_now parameter, that balloons when AC is connected.

I don't know if this is a bug or if I'm the only one affected. Using upower the information displayed seems correct.

Moreover, suppose I want to edit the style of these notifications, i.e. I want the date (and only the date) to be displayed in bold. Can this be done from the i3 config file? I'm asking because it looks to me that qubes-i3status outputs one string with all the relevant information in it. In this case I suppose I'd have to edit qubes-i3status itself to output the string with the colors I want or, probably better, I should post-process the string with some other script before passing it to the i3 config file.
Any comment on this would be appreciated.

Thanks for your Time
Fab.

Daniel Moerner

unread,
Feb 18, 2017, 4:24:59 PM2/18/17
to themastero...@gmail.com, qubes-devel
On Sat, Feb 18, 2017 at 07:02:26AM -0800, themastero...@gmail.com wrote:
> Hello Everyone,
>
> I was giving a look at /bin/qubes-i3status and realized that it is supposed
> to show also battery info in the statusbar along with disk usage, time and
> so on. This does not happen for me. The reason is that at some point the
> script looks for /sys/class/power_supply/BAT*/energy_now and
> /sys/class/power_supply/BAT*/energy_full to calculate the charge percentage
> of the battery. Unfortunately, energy_now and energy_full are not present
> in /sys/class/power_supply/BAT* for me. I tried to edit the script using
> instead charge_now and charge_full. Doing this, the battery information is
> correctly displayed when AC is disconnected, but when it's not it balloons
> up to 137%. This is not a problem of the script itself but of the
> charge_now parameter, that balloons when AC is connected.
>
> I don't know if this is a bug or if I'm the only one affected. Using upower
> the information displayed seems correct.

https://github.com/QubesOS/qubes-issues/issues/2629

It looks like that bug report needs more info from people affected by
the bug, so maybe you could look through it and reply.

>
> Moreover, suppose I want to edit the style of these notifications, i.e. I
> want the date (and only the date) to be displayed in bold. Can this be done
> from the i3 config file? I'm asking because it looks to me that
> qubes-i3status outputs one string with all the relevant information in it.
> In this case I suppose I'd have to edit qubes-i3status itself to output the
> string with the colors I want or, probably better, I should post-process
> the string with some other script before passing it to the i3 config file.
> Any comment on this would be appreciated.

Yes, you need to edit qubes-i3status. Better than editing the command
itself would probably be to copy it and make your edits with your own
custom command.

Daniel
signature.asc
Reply all
Reply to author
Forward
0 new messages