You are not logged in.
On a recently-upgraded Debian Bullseye VM (with the current Lithium BL packages) most things seem to be working OK, except xfce4-power-manager has no proper icon in tint2's system tray - just a generic "not found" sort of thing. This seems true with other icon themes (I tried Adwaita and Faenza) so it's not coming from our tweaked icon set.
Systray on bottom-right, third icon from left:
Current apt sources are:
deb https://deb.debian.org/debian bullseye main non-free contrib
deb https://kelaino.bunsenlabs.org/~johnraff/debian beryllium main
deb https://pkg.bunsenlabs.org/debian lithium main
(The kelaino repo will hold the migrated Beryllium packages, but right now only bunsen-common.)
upower -d on the VM:
Device: /org/freedesktop/UPower/devices/DisplayDevice
power supply: no
updated: Wed 03 Feb 2021 13:13:51 JST (2982 seconds ago)
has history: no
has statistics: no
unknown
warning-level: none
icon-name: 'battery-missing-symbolic'
Daemon:
daemon-version: 0.99.11
on-battery: no
lid-is-closed: no
lid-is-present: no
critical-action: HybridSleep
Found this xfce issue, but no fix (the dev seems less interested in supporting generic systray icons than in the xfce4 panel plugin):
https://gitlab.xfce.org/xfce/xfce4-powe … issues/104
strace xfce4-power-manager 2>&1 | grep 'open.*/usr/share/icons' (last 3 lines):
openat(AT_FDCWD, "/usr/share/icons/Papirus-Dark/48x48/status/ac-adapter.svg", O_RDONLY) = 14
openat(AT_FDCWD, "/usr/share/icons/Papirus-Dark/16x16/actions/image-missing.svg", O_RDONLY) = 14
openat(AT_FDCWD, "/usr/share/icons/Papirus-Dark/24x24/status/image-missing.svg", O_RDONLY) = 14
It seems to be displaying the image-missing icon.
Any input appreciated!
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )
Offline
I noticed this on a BL system that has been upgraded to Sid and as the system is a desktop not a laptop there's no battery, except for my connected bluetooth mouse's battery.
On Buster/Lithium the empty/missing battery icon is correctly shown. Maybe add such an icon to the BL icon set for all the themes that are shipped with BL for beryllium?
Last edited by DeepDayze (2021-02-03 17:02:13)
Real Men Use Linux
Offline
FWIW if you are using xfce4 4.16 the power icon is black for most themes and does not work like it did before....
Pax vobiscum,
Mark Rabideau - http://many-roads.com
dwm on Debian/Devuan (non-systemd) /arch ~ Reg. Linux User #449130
"For every complex problem there is an answer that is clear, simple, and wrong." H. L. Mencken
Offline
The error occurs with the new Xfce4 v4.16 that is shipping with bullseye if I'm not mistaken.
As it appears, xfce4-power-manager only displays the correct battery icon in the systray when 'Papirus' is set as default icon theme.
And even then, it doesn't show correctly, i.e. not adhering to light/dark icon theme settings.
see below scrot snip showing a black battery icon, in spite of 'Papirus-Dark' theme is selected.
On this MX Fluxbox system, I have a battery executor as a workaround to show battery depletion/charging levels (also shown in the scrot in white - as it should be)
EDIT: @manyroads meantime already posted a similar reply.....
Last edited by ceeslans (2021-02-03 18:21:52)
Online
The error occurs with the new Xfce4 v4.16 that is shipping with bullseye if I'm not mistaken.
As it appears, xfce4-power-manager only displays the correct battery icon in the systray when 'Papirus' is set as default icon theme.
And even then, it doesn't show correctly, i.e. not adhering to light/dark icon theme settings.
see below scrot snip showing a black battery icon, in spite of 'Papirus-Dark' theme is selected.https://i.imgur.com/Orq8E2T.png
On this MX Fluxbox system, I have a battery executor as a workaround to show battery depletion/charging levels (also shown in the scrot in white - as it should be)EDIT: @manyroads meantime already posted a similar reply.....
Then maybe a tint2 executor would be a good workaround to correct this "bug". Perhaps share your executor setup for this?
Real Men Use Linux
Offline
Then maybe a tint2 executor would be a good workaround to correct this "bug". Perhaps share your executor setup for this?
Here you go.
You can either set the icon path to the 'Papirus' panel icons in /usr/share/icons - or to the icon folder in ~/.config/tint2 (grab the archive in below link).
The script is set to the commonly used BAT0 levels. If so needed, change the path to BAT1.
~/.config/tint2/executors/battery
#!/bin/bash
iconpath="/usr/share/icons/Papirus-Dark/24x24/panel/"
#iconpath="$HOME/.config/tint2/executors/icons/battery/"
status=$(cat /sys/class/power_supply/BAT0/status)
perc=$(cat /sys/class/power_supply/BAT0/capacity)
if [[ $status = "Discharging" ]]; then
if [[ $perc -ge 91 ]]; then
echo "${iconpath}battery-full.svg"
echo "$perc%"
elif [[ $perc -ge 71 ]]; then
echo "${iconpath}battery-good.svg"
echo "$perc%"
elif [[ $perc -ge 51 ]]; then
echo "${iconpath}battery-medium.svg"
echo "$perc%"
elif [[ $perc -ge 31 ]]; then
echo "${iconpath}battery-low.svg"
echo "$perc%"
elif [[ $perc -ge 16 ]]; then
echo "${iconpath}battery-caution.svg"
echo "$perc%"
elif [[ $perc -ge 1 ]]; then
echo "${iconpath}battery-empty.svg"
echo "$perc%"
fi
elif [[ $status = "Charging" ]]; then
if [[ $perc -ge 90 ]]; then
echo "${iconpath}battery-full-charging.svg"
echo "$perc%"
elif [[ $perc -ge 70 ]]; then
echo "${iconpath}battery-good-charging.svg"
echo "$perc%"
elif [[ $perc -ge 50 ]]; then
echo "${iconpath}battery-medium-charging.svg"
echo "$perc%"
elif [[ $perc -ge 30 ]]; then
echo "${iconpath}battery-low-charging.svg"
echo "$perc%"
elif [[ $perc -ge 15 ]]; then
echo "${iconpath}battery-caution-charging.svg"
echo "$perc%"
elif [[ $perc -ge 1 ]]; then
echo "${iconpath}battery-empty-charging.svg"
echo "$perc%"
fi
else
echo "${iconpath}battery-full-charged.svg"
echo "$perc%"
fi
tint2rc configuration for the battery executor (adept to your personal preferences)
#-------------------------------------
# Executor (battery status)
execp = new
execp_command = ~/.config/tint2/executors/battery
execp_interval = 15
execp_has_icon = 1
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_tooltip =
execp_lclick_command = b=$(acpi -b) && notify-send "$b"
execp_rclick_command = xfce4-power-manager -c
execp_mclick_command =
execp_uwheel_command =
execp_dwheel_command =
execp_font = Noto Sans 8
execp_font_color = #eeeeee 100
execp_padding = 3 0 2
execp_background_id = 0
execp_centered = 0
execp_icon_w = 24
execp_icon_h = 24
here is the archive with the Papirus *.svg icons as called by the executor script.
~
Online
Just wanted to say thank you for sharing this ^ Really good stuff.
Ditto, thanks @ceeslans!
Real Men Use Linux
Offline
What does this executor display on a desktop machine with no battery? (Save me having to set it up to test...)
---
Without it, even with the Papirus icon theme, I get the generic "image-missing" (second icon):
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )
Offline
As it appears, xfce4-power-manager only displays the correct battery icon in the systray when 'Papirus' is set as default icon theme.
And even then, it doesn't show correctly, i.e. not adhering to light/dark icon theme settings.
This is my experience on two laptops, Manjaro and Archlinux.
So afaiu, xfce4-power-manager changed icon names, resulting in this mess because icon theme developers haven't caught up yet?
In that case a temporary icon theme that contains the correct icons & inherits whatever the usual icon theme should be - should be a simpler solution?
In any case, watch these issues for development:
https://gitlab.xfce.org/xfce/xfce4-powe … issues/104
https://github.com/PapirusDevelopmentTe … ssues/2484
Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos
Offline
Battery/laptop and AC/desktop are two different situations, though neither is working.
As I posted above, 'upower -d' suggests that it wants to display 'battery-missing-symbolic', same as one poster on the Papirus issue. That's on a VM with of course no battery - up to now it's displayed the same AC power icon I get on this Debian Buster desktop machine.
The strace output seems to imply it's passing over ac-adapter.svg and choosing image-missing.svg
I don't see what new icons a theme would have to provide to get this working. If we had some names that work it wouldn't be hard to add them to our tweaked icon theme.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )
Offline
Similar executor setup could be made, but not using icons, but some sort of textual representations, maybe even symbols from some nerd font (in a way that doesn't visually clash with user selected icons). The more interesting questions are:
a. Is xfce4-power-manager really worth the trouble? (Is this thing in everyday use by people?), I don't recall ever using it. < edit: Actually it doesn't matter, independent display is still a worthy cause.
b. Only if a is true, is there a recipe for a continuous version of this executor, maybe based on
upower -m
Monitoring activity from the power daemon. Press Ctrl+C to cancel.
[11:13:12.931] device changed: /org/freedesktop/UPower/devices/battery_BAT0
Edit: quick test, proof of concept
#!/bin/bash
# printBatteryCont
# 'continuously' print machine power state for tint2
# license: WTFPL – Do What the **** You Want to Public License
# main
(upower -m) |
while read
do
num="$(upower -d | grep percentage | head -1 | tr -dc '0-9')"
echo "${num}%"
done
Edit2: Actually, why not just use tint2 battery thing?
https://gitlab.com/o9000/tint2/blob/mas … md#battery
Last edited by brontosaurusrex (2021-02-04 12:54:34)
Offline
What does this executor display on a desktop machine with no battery? (Save me having to set it up to test...)
---
Without it, even with the Papirus icon theme, I get the generic "image-missing" (second icon):
https://imgur.com/y4GgAzFl.png
Yes I get that too...just tested the executor last night on the desktop that has Sid on it. Something seems to be indeed off with the icon names. A good representation of no-battery icon would be the either the AC icon or a battery with a large X through it as generally desktops are always on AC.
On a laptop with no battery or a totally dud one, then the AC bolt on empty battery should be shown.
Last edited by DeepDayze (2021-02-04 14:40:14)
Real Men Use Linux
Offline
johnraff wrote:What does this executor display on a desktop machine with no battery? (Save me having to set it up to test...)
---
Without it, even with the Papirus icon theme, I get the generic "image-missing" (second icon):
https://imgur.com/y4GgAzFl.pngYes I get that too...just tested the executor last night on the desktop that has Sid on it. Something seems to be indeed off with the icon names. A good representation of no-battery icon would be the either the AC icon or a battery with a large X through it as generally desktops are always on AC.
On a laptop with no battery or a totally dud one, then the AC bolt on empty battery should be shown.
Seems like there is always something that has to be further worked out eh?
Would it be possible to have two tint2 scripts (one with & one without), calling the correct one based on whether a battery is present or not?
or to just ignore the executor?
This would save from having any icon at all if not on battery.
Edit2: Actually, why not just use tint2 battery thing?
https://gitlab.com/o9000/tint2/blob/mas … md#battery
This works fine as well, but for myself,I could never get an icon to work, just text. so:
"BAT %45" would be the best I could do. If someone works out the icon bit, this could work well I think.
Last edited by sleekmason (2021-02-04 15:09:34)
Offline
Turns out that even plebeian fonts like Cuprum have battery symbols embedded, which is nice for our evil plan (And fonts in tint are colored as well fonts).
So slightly expanded continuous example
https://raw.githubusercontent.com/bront … atteryCont
gives
Symbol should turn into rocket when battery is >80% charged.
What is missing: states (perhaps 'charging' and 'AC' are just enough info < that must go into tooltip imho)
And added states as tooltip.
Where tint2rc executor is
#-------------------------------------
# printBatteryCont
execp = new
execp_centered = 1
execp_has_icon = 0
execp_command = printBatteryCont
execp_continuous = 1
execp_font = cuprum 21
execp_font_color = #111111 100
execp_padding = 0 0 0
#execp_tooltip =
execp_mclick_command = xfce4-power-manager-settings
p.s. Design-wise, more interesting version of this could use images (as in ceeslans example), where bunsen logo would be painted in a way to tell the levels. Perhaps reusing tint2 start button....
Last edited by brontosaurusrex (2021-02-04 20:04:34)
Offline
Turns out that even plebeian fonts like Cuprum have battery symbols embedded, which is nice for our evil plan (And fonts in tint are colored as well fonts).
So slightly expanded continuous example
https://raw.githubusercontent.com/bront … atteryCont
gives
https://images.weserv.nl/?url=https://i.imgur.com/D7NhlwWb.png
Symbol should turn into rocket when battery is >80% charged.What is missing: states (perhaps 'charging' and 'AC' are just enough info < that must go into tooltip imho)
And added states as tooltip.
https://images.weserv.nl/?url=https://i.imgur.com/qDTXTA5b.png
Where tint2rc executor is#------------------------------------- # printBatteryCont execp = new execp_centered = 1 execp_has_icon = 0 execp_command = printBatteryCont execp_continuous = 1 execp_font = cuprum 21 execp_font_color = #111111 100 execp_padding = 0 0 0 #execp_tooltip = execp_mclick_command = xfce4-power-manager-settings
p.s. Design-wise, more interesting version of this could use images (as in ceeslans example), where bunsen logo would be painted in a way to tell the levels. Perhaps reusing tint2 start button....
Now that be a cool effect!
Real Men Use Linux
Offline
I think so, that would also cover:
Would it be possible to have two tint2 scripts (one with & one without), calling the correct one based on whether a battery is present or not?
or to just ignore the executor?
This would save from having any icon at all if not on battery.
So in case of 'not a laptop' the icon does its primary menu duty, else it paints accordingly to charged state (maybe rotate even) AND does its primary menu duty.
Last edited by brontosaurusrex (2021-02-04 20:33:32)
Offline
One small issue with the Cuprum fonts - Cuprum is part of the texlive-fonts-extra (432MB)
Is there another that can be used solo that is lightweight?
Edit* Or I guess just those fonts copied . . nevermind.
Last edited by sleekmason (2021-02-04 20:50:03)
Offline
I think so, that would also cover:
sleekmason wrote:Would it be possible to have two tint2 scripts (one with & one without), calling the correct one based on whether a battery is present or not?
or to just ignore the executor?
This would save from having any icon at all if not on battery.So in case of 'not a laptop' the icon does its primary menu duty, else it paints accordingly to charged state (maybe rotate even) AND does its primary menu duty.
In the case of not a laptop then the AC icon (same one shown when a laptop is on AC and full battery) should be displayed in the tray by default. Of course the menu options applicable should also be accessible.
Last edited by DeepDayze (2021-02-04 20:48:45)
Real Men Use Linux
Offline
One small issue with the Cuprum fonts - Cuprum is part of the texlive-fonts-extra (432MB)
Is there another that can be used solo that is lightweight?Edit* Or I guess just those fonts copied . . nevermind.
Actually I'm not sure how this special chars are handled (after some more testing), since this seems to work with any font I choose. Perhaps I have some magic font installed which is inherited from any font...
Offline
No news on the 2 issues.
As I posted above, 'upower -d' suggests that it wants to display 'battery-missing-symbolic', same as one poster on the Papirus issue. That's on a VM with of course no battery - up to now it's displayed the same AC power icon I get on this Debian Buster desktop machine.
The strace output seems to imply it's passing over ac-adapter.svg and choosing image-missing.svg
I don't see what new icons a theme would have to provide to get this working. If we had some names that work it wouldn't be hard to add them to our tweaked icon theme.
Everything I read in those 2 issues points to changes in xfce4-power-manager resulting in icon theme incompatibility.
Your strace output from post #1 suggests that xfce4-power-manager is looking for different sizes - 48px first, then 16 and 24 iirc.
Maybe if you increase the panel's system tray icon size to >=48 the icon will change?
Maybe if you make sure that the relevant icons are not only provided, but provided in all relevant sizes?
Unfortunately I cannot reproduce the issue on my laptop, which is Archlinux but uses tint2 and xfce4-power-manager, but I did notice some changes (as ceeslans posted: correct icons, but dark instead of light, and wrong size).
This makes me confident that a fix is on the way.
Of course, for Debian-stable users there's the problem with freezes for testing - if upstream doesn't hurry up you could be stuck with this for 2 years
Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos
Offline
Another option (the actual tray icon) would be to script something up using some yad magic, example
yad --notification --image="geany" --command="echo 'Hello World'" --text="The notification's tooltip"
Offline
Unfortunately I cannot reproduce the issue on my laptop, which is Archlinux but uses tint2 and xfce4-power-manager, but I did notice some changes (as ceeslans posted: correct icons, but dark instead of light, and wrong size).
This makes me confident that a fix is on the way.
Of course, for Debian-stable users there's the problem with freezes for testing - if upstream doesn't hurry up you could be stuck with this for 2 years
There is hardly any time left now for the fix to arrive in Debian Bullseye. I guess if something arrives in unstable we might be able to backport it.
It's a pity because I don't know of any other app that handles power/screen/suspend without being tied into a big DE. (There are various other ways of getting a battery status icon though.) It's all less important on a desktop with AC only of course. The main thing I missed on a laptop was effective notification when the battery is running out, before suspend kicks in. There is another xfce app xfce4-battery-plugin which although it's supposed to be an xfce4-panel plugin, still manages to do notifications by itself. A bit tricky to configure though.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )
Offline
I don't know how useful this is but I've used mate-power-manager with tint2 and openbox in the past.
This is the installation output on a fairly vanilla Lithium/Buster system:
rkw@rose:~$ sudo apt install mate-power-manager
[sudo] password for rkw:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libmate-panel-applet-4-1 mate-power-manager-common
Suggested packages:
mate-polkit
The following NEW packages will be installed:
libmate-panel-applet-4-1 mate-power-manager mate-power-manager-common
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 2,927 kB of archives.
After this operation, 14.1 MB of additional disk space will be used.
Do you want to continue? [Y/n]
The depends according to apt show
Depends: default-dbus-session-bus | dbus-session-bus, mate-notification-daemon | notification-daemon, mate-power-manager-common (= 1.20.3-2), policykit-1, systemd | elogind | consolekit, upower, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.27), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libcanberra-gtk3-0 (>= 0.25), libcanberra0 (>= 0.2), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>= 0.88), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.37.3), libgtk-3-0 (>= 3.21.4), libmate-panel-applet-4-1 (>= 1.18), libnotify4 (>= 0.7.0), libpango-1.0-0 (>= 1.22.0), libpangocairo-1.0-0 (>= 1.14.0), libupower-glib3 (>= 0.99.0), libx11-6, libxext6, libxrandr2 (>= 2:1.2.99.2)
Maybe an alternative to consider
Offline
^Thanks for the idea Nick.
I've just tried an install on a VM for a quick look. For some reason, installing the same 3 packages took 17MB not 14 for me, anyway quite a bit more than xfce-p-m. RAM usage was about the same. The settings interface is somewhat simpler.
m-p-m has come up in the past too, let's keep it in mind if x-p-m turns out to be unusable.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )
Offline