Skip to main content
Topic: Is there a way to implement systray in wayland w/o dbus? (Read 3751 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Is there a way to implement systray in wayland w/o dbus?

So, since mesa deprecated gallium-xa which means that X may be destroyed any time soon, i've started digging whether i can reproduce my X setup on wayland. As a dwm user, i find dwl to be the closest option. However, there are some options it neither provids itself, nor do currently submitted patches. For me those are:
1) systray
2) keyboard layout display
3) list of windows on active tag
While, i suppose, i could deal with 2 and 3 myself, the only systray implementation is via bar-systray patch. However, the latter makes dbus a heavy requirement for starting dwl which i don't like at all. Therefore, i ask, does anyone know any wayland systray implementations which do not require dbus session to be active?
ARMtix
If you need to contact me, use email

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #1
I'm a dwl user too (with yambar as status bar).

I've no answer for the title in question as that's out of my depth. I've only have a elogind free setup. I haven't delved into dbus.

If starting dwl with dbus is the issue. Would having a status bar (waybar) that depends on libelogind (which depends on dbus) without launching dbus be fine? (Note: I haven't tried this nor am I certain that this will work.)

My previous setup was sway + waybar. I haven't tried dwl + waybar.

Not really the answer you're looking for. I'm just laying out ideas.

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #2
Would having a status bar (waybar) that depends on libelogind (which depends on dbus) without launching dbus be fine?
Looking through waybar code was the first idea i had. Starting from systray.cpp, it didn't take me 3 minutes of just opening include files to find dbus header used.
ARMtix
If you need to contact me, use email

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #3
Would having a status bar (waybar) that depends on libelogind (which depends on dbus) without launching dbus be fine?
Looking through waybar code was the first idea i had. Starting from systray.cpp, it didn't take me 3 minutes of just opening include files to find dbus header used.


I am listening to see what I can learn here, so excuse me for what might sound confused.  But if you have a system tray, you will need some form of inter-process communication?  Am I wrong?  Is that not the primary purpose of a system tray?

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #4
But if you have a system tray, you will need some form of inter-process communication? Is that not the primary purpose of a system tray?
Good question. AFAIK there are some built-in wayland ipc mechnisms, as well as dwl-specific ipc (the latter however does not support any systray-related info by default).
The reason why i question in the first place is that there is a systray patch for dwm which does not require dbus at all. Maybe it is some Xorg-specific magic that cannot be implemented in wayland. Maybe not. That's why i ask.
ARMtix
If you need to contact me, use email

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #5
I think you are out of luck if you want to avoid dbus.
The reason why i question in the first place is that there is a systray patch for dwm which does not require dbus at all. Maybe it is some Xorg-specific magic that cannot be implemented in wayland. Maybe not. That's why i ask.
It is X specific
https://specifications.freedesktop.org/systemtray-spec/0.3/  (XEmbed system tray spec) is what dwm is using.
All the solutions to embed XEmbed tray icons in wayland's SNI (StatusNotifierItem) systrays use dbus AFAIK. As programs can't directly communicate with, or control, each other on wayland by design.

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #6
As programs can't directly communicate with, or control, each other on wayland by design.
Shame. I hoped, there could exist a way based on wayland client<->compositor ipc
ARMtix
If you need to contact me, use email

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #7
A different alternative would be to directly code it in a status bar. Although it would most likely still need dbus (or libdbus for a soystemd-free alternative than sd-dbus. Check link below.).

I'm not sure what's you're reasoning for not using dbus, but I think I can assume it's because of soystemd. Being in Artix forums
as well as it reminded me of this post from a yambar pull request of wanting to implement a Icon & Tray support:
https://codeberg.org/dnkl/yambar/pulls/324

Note: yambar has ended development last month ago. But I think that pull request discussion can also offer some insight, and maybe inspiration for your code should you plan to do a diy solution.

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #8
A different alternative would be to directly code it in a status bar.
The problem is not about where to do it, but how

I'm not sure what's you're reasoning for not using dbus, but I think I can assume it's because of soystemd.
I don't like to be forced to use dbus for desktop to be functional. Although i currently start dwm inside dbus session, i can safely start it w/o dbus and all i lose would be some fancy integration which isn't critical for me. That's what i want from wayland, and looks like i'm not getting it.

However, briefly reading about wayland api, i found wl_data_source / wl_data_offer pair of functions. If those can be used to get information about incoming mesages/emails from respective apps, it would be fine for me. I suppose, GUI for clipboard manager can be implemented separately w/o using systray.
ARMtix
If you need to contact me, use email

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #9
A different alternative would be to directly code it in a status bar.
The problem is not about where to do it, but how

I'm not sure what's you're reasoning for not using dbus, but I think I can assume it's because of soystemd.
I don't like to be forced to use dbus for desktop to be functional. Although i currently start dwm inside dbus session, i can safely start it w/o dbus and all i lose would be some fancy integration which isn't critical for me. That's what i want from wayland, and looks like i'm not getting it.

However, briefly reading about wayland api, i found wl_data_source / wl_data_offer pair of functions. If those can be used to get information about incoming mesages/emails from respective apps, it would be fine for me. I suppose, GUI for clipboard manager can be implemented separately w/o using systray.

I see so my assumption was wrong. The issue was is having dbus(likely including libdbus) in general (which probably means the link I gave was pointless). Yeah, unfortunately seems like there's no other way (that I now of).

As for the wayland api, that's out of my depth. Same goes for the GUI clipboard manager.

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #10
As programs can't directly communicate with, or control, each other on wayland by design.



To me, this just sounds like another reason not to have wayland.  Why is this watered down, feature deficient software being forced on the community.  For a new thing, it is a major step backwards and devoid of anything modern or particularly useful.  It is neutered.

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #11
To me, this just sounds like another reason not to have wayland.  Why is this watered down, feature deficient software being forced on the community.  For a new thing, it is a major step backwards and devoid of anything modern or particularly useful.  It is neutered.
I completely agree.
16 years old now and still doesn't work. In my most humble opinion.

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #12
To me, this just sounds like another reason not to have wayland.  Why is this watered down, feature deficient software being forced on the community.  For a new thing, it is a major step backwards and devoid of anything modern or particularly useful.  It is neutered.
I completely agree.
16 years old now and still doesn't work. In my most humble opinion.


Consider that X was written by a few MIT undergrads in there spare time

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #13
I got an idea which could probably partially resolve the issue, at least for me: if there is a way to get icon of the application and this icon is changed on some events (new messages/emails), then a section with these icons would effectively replace systray for me. Since i target dwl, i could use already established rules mechanism to filter only those apps i really need in tray.
The major issue, however, is to get icon of given client
ARMtix
If you need to contact me, use email

Re: Is there a way to implement systray in wayland w/o dbus?

Reply #14
I got an idea which could probably partially resolve the issue, at least for me: if there is a way to get icon of the application and this icon is changed on some events (new messages/emails), then a section with these icons would effectively replace systray for me. Since i target dwl, i could use already established rules mechanism to filter only those apps i really need in tray.
The major issue, however, is to get icon of given client


That is exactly what window maker originally did.