You are not logged in.

#26 2021-02-25 20:00:13

ghorvath
Member
Registered: 2015-10-01
Posts: 154

Re: xfce4-power-manager systray icon missing on Debian Bullseye

ceeslans wrote:
DeepDayze wrote:

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.
~

This code doesn't give me the icons to the tint panel, only the percentage value. I do have the proper path for the icons, and when I run the executor from a terminal, it gives me the correct icon file path.

Is there something trivial I'm missing here?

The only change I did to the lithium default tint2 config file is this line:

panel_items = PTSBCP

and of course I added the lines above to the end of the tint2 config file.

What else would be needed from me so someone could help me troubleshoot this?

Thanks,
ghorvath

Offline

#27 2021-02-26 09:00:56

ceeslans
Member
Registered: 2015-09-30
Posts: 107

Re: xfce4-power-manager systray icon missing on Debian Bullseye

ghorvath wrote:

The only change I did to the lithium default tint2 config file is this line:

panel_items = PTSBCP

and of course I added the lines above to the end of the tint2 config file.

What else would be needed from me so someone could help me troubleshoot this?

Noticed that your panel_items line doesn't include an 'E' for the executor.
It should look something like this:

panel_items = PTESBCP

hope this helps

Offline

#28 2021-02-26 10:50:42

ghorvath
Member
Registered: 2015-10-01
Posts: 154

Re: xfce4-power-manager systray icon missing on Debian Bullseye

Noticed that your panel_items line doesn't include an 'E' for the executor.
It should look something like this:

panel_items = PTESBCP

hope this helps

This is exactly what I needed. Works perfectly now. Thanks!

Offline

Board footer

Powered by FluxBB