Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-04-02 23:22:33

OpNop
Member
Registered: 2018-04-02
Posts: 5

Battery indicator not showing all levels

Hello, I am having an issue with the battery level icons in the panel. it seems to be only showing the 100%, 80% and 20% icons

I can see in the icon packs folder for Papirus-Dark has icons for 100, 80, 60, 40, 20, 00

Running
OS: ArchMerge v6.5.1
XFCE: 4.12
Theme: Arc-Dark
Icons: Papirus-Dark

Thanks

Attached is some screen shots of what I'm talking about

Battery%20Level.png?dl=0&raw=1
Battery%20Level%202.png?dl=0&raw=1

Offline

#2 2018-04-02 23:53:41

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,492

Re: Battery indicator not showing all levels

Hello and welcome.

You don't mention the version of xfce4-power-manager, but I'm guessing it's greater than 1.5.0. In this release, the icons were migrated to upowerd icon names. You can get these by running:

upower -d

Basically, they are now empty, caution, low, good, and full.

From the 1.5.0 release notes:

The panel plugin now uses UPower's icon names
   directly and is consequently compatible with all
   major icon themes out of the box


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2018-04-03 00:03:23

OpNop
Member
Registered: 2018-04-02
Posts: 5

Re: Battery indicator not showing all levels

Ahh yes, I am running Xfce Power Manager 1.6.1 and it shows (currently charging @ 94%)

icon-name:          'battery-full-charging-symbolic'

Is there a way to get better representation of the charge with the new icon system? for example when I was charging, it was showing the Full Charging icon when it was at 65% charge

EDIT:
after posting I checked to see what version of Papirus-Dark I had installed and saw I had papirus-icon-theme-git from AUR that was last updated in 2017, changed over to the papirus-icon-theme  20180401-1 from the community Repo, discharging the laptop now to see if that fixes it.

Last edited by OpNop (2018-04-03 00:09:26)

Offline

#4 2018-04-03 00:22:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,492

Re: Battery indicator not showing all levels

OpNop wrote:

Is there a way to get better representation of the charge with the new icon system? for example when I was charging, it was showing the Full Charging icon when it was at 65% charge

Not using the regular panel icon which is dependent on upower.

Shameless plug incoming.....

You could use xfce4-genmon-plugin to do this for you. Here is a script:

#!/bin/bash

ICON_DIR=/home/toz/.icons/bat/
ICON_EXT=svg
BATTERY_NAME="/org/freedesktop/UPower/devices/battery_BAT0"

STATE=$(upower -i $BATTERY_NAME | grep -E "state|to\ full|time\ to\ empty|percentage" | grep state | tr -s " " | cut -d' ' -f3)
TOFULL=$(upower -i $BATTERY_NAME | grep -E "state|to\ full|percentage" | grep "to full" | tr -s " " | cut -d' ' -f5-)
TOEMPTY=$(upower -i $BATTERY_NAME | grep -E "state|to\ full|time\ to\ empty|percentage" | grep "time to empty" | tr -s " " | cut -d' ' -f5-)
PERCENTAGE=$(upower -i $BATTERY_NAME | grep -E "state|to\ full|time\ to\ empty|percentage" | grep "percentage" | tr -s " " | cut -d' ' -f3 | sed -e 's/\%//g')

case $STATE in
    "charging") S="c" ;;
    "discharging") S="" ;;    
    "fully-charged") S"f";
esac

case $PERCENTAGE in
    [0-9]|1[0-9]) ICON=0$S.$ICON_EXT ;;
    2[0-9]|3[0-9]) ICON=1$S.$ICON_EXT ;;
    4[0-9]|5[0-9]|6[0-9]|7[0-9]) ICON=6$S.$ICON_EXT ;;    
    8[0-9]|9[0-9]|100) ICON=9$S.$ICON_EXT ;;    
    *) ICON=x.$ICON_EXT ;;
esac

case $STATE in
    "charging")
    echo "<img>$ICON_DIR$ICON</img><tool>--== Power Manager ==--
State:          $STATE
To Full:         $TOFULL
Percentage: $PERCENTAGE%</tool><click>xfce4-power-manager-settings</click>"
;;

    "discharging")
    echo "<img>$ICON_DIR$ICON</img><tool>--== Power Manager ==--
State:          $STATE
To Empty:    $TOEMPTY
Percentage: $PERCENTAGE%</tool><click>xfce4-power-manager-settings</click>"
;;    

    "fully-charged")
    echo "<img>$ICON_DIR$ICON</img><tool>--== Power Manager ==--
State:          $STATE
Percentage: $PERCENTAGE%</tool><click>xfce4-power-manager-settings</click>"
;;
esac

#echo $STATE
#echo $TOFULL
#echo $TOEMPTY
#echo $PERCENTAGE
#echo $ICON

exit 0

...and here is a set of icons to start with (put the bat directory into ~/.icons. Feel free to edit them as required. You could change the code and create icons to whatever ganularity you like.

Hopefully the code is self-explanatory. You might need to change the default settings in lines 3-5 to suit your system.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2018-04-03 20:58:32

OpNop
Member
Registered: 2018-04-02
Posts: 5

Re: Battery indicator not showing all levels

Well I have some news to report.

I haven't tried your script just yet, mostly because I feel the base system should work with a proper icon pack. however after swapping the icon pack version, upower seems to be stuck as saying it wants battery-full-symbolic when the battery is at 60%

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               LGC-LGC3.95
  model:                DELL 92NCT53N
  serial:               36286
  power supply:         yes
  updated:              Tue 03 Apr 2018 01:55:09 PM MST (59 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              23.2878 Wh
    energy-empty:        0 Wh
    energy-full:         38.184 Wh
    energy-full-design:  43.845 Wh
    energy-rate:         7.8588 W
    voltage:             11.332 V
    time to empty:       3.0 hours
    percentage:          60%
    capacity:            87.0886%
    technology:          lithium-ion
    icon-name:          'battery-full-symbolic'
  History (charge):
    1522788909	60.000	discharging
  History (rate):
    1522788909	7.859	discharging

Offline

#6 2018-04-03 21:04:37

OpNop
Member
Registered: 2018-04-02
Posts: 5

Re: Battery indicator not showing all levels

Finally changed status to battery-good-symbolic at 58%. seems way out of whack.

Offline

#7 2018-04-03 21:10:18

OpNop
Member
Registered: 2018-04-02
Posts: 5

Re: Battery indicator not showing all levels

Well bleh, looking at the source [link]https://cgit.freedesktop.org/upower/tre … vice.c#n94[/link] thats what its supposed to do. so looks like I will for sure be using your script to get a bit more control over the icons rather then recompiling upower

Offline

#8 2018-04-04 00:15:09

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: Battery indicator not showing all levels

I don't know why they can't simply put an outline of a battery with a number from 1 to 100 (percent) inside it, lol. I don't suppose you'd need a zero (that one seems like it would be self-evident).

Are laptop batteries truly linear? If not, an actual percentage would probably be much more useful. But IDK. My (laptop's) battery has been non-functional for at least a year; the power/charging light just  s-l-o-w-l-y  blinks on and off, orange. I have been afraid to attempt to crack it open to try a repair with some kind of little batteries. Plus, there are more than two connection points - which tells me there's more than a simple two-way voltage path. I am thinking about the Epson(?) printer ink cartridges that had a little chip inside, that told the printer when the cartridge was "no good." Things are really tight right now and I would hate to save up to get replacement battery parts only to learn that these things keep track of the number of charge cycles and, for whatever reason (greed, possibly?), stop allowing a charge cycle to take place after an arbitrary number of them has occurred. Plus, I have no way of knowing whether it is the battery that is at fault or something in the laptop itself. But I DO know that a functional battery would be a wonderful thing. I'm well beyond being tired of even the shortest power "blink" immediately - and harshly(!) - shutting off my laptop.

Regards,
MDM

Last edited by MountainDewManiac (2018-04-04 00:20:58)


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 8 queries executed - Memory usage: 574.63 KiB (Peak: 591.47 KiB) ]