-
-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systray: add :visible-empty
property for systray
widget
#1097
base: master
Are you sure you want to change the base?
Conversation
:visible-empty
property:visible-empty
property for systray
widget
Most likely this is not the best solution, I think it’s worth passing a condition on the number of elements in the tray in :visible, you don’t have to merge this PR. But it’s certainly worth fixing removing elements from the tray. This also conflicts with the :visible property. |
@jlo62, i wrote a stupid script to count the number of elements in the tray, you can use it together with #!/bin/bash
count=0
dbus-monitor --session "interface='org.kde.StatusNotifierWatcher'" |
while read -r signal; do
if [[ $signal == *"StatusNotifierItemRegistered"* ]]; then
count=$(($count + 1))
elif [[ $signal == *"StatusNotifierItemUnregistered"* ]] then
count=$(($count - 1))
fi
echo $count
done
|
@elkowar, perhaps this method should be added to the docs or add a magic variable with the number of elements in the systray. Perhaps it’s generally worth disabling the widget’s display by default if there are no elements in it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think adding a magic var would be a lot nicer, but i'd have to investigate whether this is difficult from an architectural standpoint.
since there has been little activity on this pr, do you mind me adopting it?
i'd then see where i can take this idea (i'd probably attempt to implement a magic var since that's far more flexible)
Description
Issue
Added the
:visible-empty
property for thesystray
widget. By default, an empty tray is displayed.I also noticed a problem that tray elements are not removed from
systray.items
.Usage
Showcase
2024-05-05.22-14-11.mp4
Additional Notes
This is my first time writing in rust, so I might have made mistakes, please check carefully to see. I'm ready to correct mistakes.
As far as I understand, the documentation for widgets is generated automatically.
Checklist
Please make sure you can check all the boxes that apply to this PR.
docs/content/main
directory has been adjusted to reflect my changes.cargo fmt
to automatically format all code before committing