Skip to content
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

StatusNotifierItem support #2995

Open
judemille opened this issue Feb 16, 2020 · 23 comments
Open

StatusNotifierItem support #2995

judemille opened this issue Feb 16, 2020 · 23 comments

Comments

@judemille
Copy link

The XEmbed tray specification is outdated, and whether we like it or not, most major DEs and applications are switching to StatusNotifierItem, commonly through libappindicator. The menus and icons are transmitted over DBus, and to simplify implementation, we could use libdbusmenu-gtk3, as the dbusmenu spec is quite complex to implement.

@psychon
Copy link
Member

psychon commented Feb 17, 2020

we could use libdbusmenu-gtk3

I tried to take a look at it. Ended up with https://bazaar.launchpad.net/~dbusmenu-team/libdbusmenu/trunk.16.10/files/head:/libdbusmenu-gtk and https://gjs-docs.gnome.org/dbusmenu04~0.4_api/ and I still have no idea how this is supposed to work.

@judemille
Copy link
Author

judemille commented Feb 17, 2020

taffybar has managed to figure it out, but that is in Haskell. It could still be used as a reference.

@judemille
Copy link
Author

vala-panel has also implemented SNI and Global Menu using libdbusmenu

@judemille
Copy link
Author

judemille commented Feb 17, 2020

The Vala implementation is likely easier to read for most people. I wonder if we could just plug this widget in instead of reinventing the wheel. The DE-specific parts aren't that huge. It seems to just be telling DEs how to handle its GTK widget.

@Elv13
Copy link
Member

Elv13 commented Feb 17, 2020

I didn't read the code, but GTK3 cannot be plugged into AwesomeWM. GTK3 depends on the window manager and cannot safely be used in the same thread as the window manager.

@judemille
Copy link
Author

I thought beautiful had a GTK3 theme, though. Is that just reading values from the GTK3 config?

@actionless
Copy link
Member

@juliandemille it's not showing the GTK window, only creating its object in order to read the StyleContext

@judemille
Copy link
Author

Ah, I see. That vastly complicates this issue.

@actionless
Copy link
Member

@Elv13 i guess with the new Layout system which you working on it should be possible to embed a client (like vala-panel or whatever) just as a normal widget on a wibar?

@AGCaesar
Copy link

After Arch upgraded to Electron 8, neither Franz (multi messenger) nur signal Icons are shown in the tray. This is quite a problem for me :/ I think there wont be a quick solution?

@dtzWill
Copy link
Contributor

dtzWill commented Mar 11, 2020

And latest keybase client release needs this now, as noted in their release notes: https://github.com/keybase/client/releases/tag/v5.3.0 (likely same issue re:new electron but didn't investigate).

Hmm... :(.

@drskalman
Copy link

Apparently Electorn 8 doesn't support old tray anymore just StatusNotifier. I have had limited succes with Taffybar: https://github.com/taffybar/taffybar it is far from perfect (including the fact that you need to recompile the whole thing using haskle everytime you change the config) but it can take over the tray from Awesome and because it support StatusNotifier, at least you won't lose all your Electorn apps when you close the window in the void.

@psychon
Copy link
Member

psychon commented Mar 23, 2020

Assuming I did not make a wrong turn somewhere: taffybar uses this library for StatusNotifierItem support: https://hackage.haskell.org/package/status-notifier-item
Looking at its code... I still cannot read haskell.

@judemille
Copy link
Author

judemille commented Mar 23, 2020 via email

@drskalman
Copy link

https://git.sr.ht/~steef/snixembed allows you to proxy StatusNotifierItems as XEmbedded systemtray-spec icons. It worked for me riot client icon re-appeared.

@AGCaesar
Copy link

AGCaesar commented May 5, 2020

Works with signal, but crashes Franz/Ferdi multimessenger. Too bad :/

@psychon
Copy link
Member

psychon commented Aug 27, 2020

Uhm. I tried to experiment a bit with this. The Gtk docs say to GNotification instead of GtkStatusIcon. However, GNotification just sends notifications, which we already support?!?
Basically, I rediscovered https://stackoverflow.com/questions/41917903/gtk-3-statusicon-replacement

Also, which spec does snixembed actually implement? It registers itself as org.kde.StatusNotifierWatcher on the bus. There is no mentioning of KDE in the StatusNotifierItem spec (at least none that I can find).

Here is my `GNotification` experiment
local lgi = require("lgi")
local Gtk = lgi.Gtk
local Gio = lgi.Gio

local app = Gtk.Application.new('org.example.app', 0)

function app:on_activate()
	local win = Gtk.Window {
		type = Gtk.WindowType.TOPLEVEL,
		application = app,
		title = "foo",
	}
	win:show_all()
	local notify = Gio.Notification.new("title")
	notify:set_body("this is the body")
	app:send_notification("test-notiy", notify)
	return win
end

app:run{arg[0], ...}

@steef435
Copy link

Hello, I am the author of snixembed. It implements necessary parts of this spec, with the exception you noticed that instead of freedesktop, kde is used. IIUC, SNI was originally a KDE project and while testing I discovered plenty software using kde and no software using the standardized naming. I believe the spec is still being used by KDE. Some projects expose both services but I saw no need in practice (and Vala did not make it easy).

There is also the AppIndicator specification (Unity) with similar aims, which seems to be based on SNI but is different and I have not found a specification. snixembed ad hoc reads a bit of it.

Bottom line though, is that it's probably not too important to support either specification for now. I made snixembed because chromium dropped support for traditional (XEmbed) tray icons in favour of only SNI. This is not a big issue for anyone I believe, but the change dripped down to Electron and then it became a problem. Electron has however reverted the change recently. So all apps mentioned in this thread should work just fine on awesome again (for now?).

libappindicator has a fallback to XEmbed tray icons if no watcher service is found, and so does e.g. the QSystemTrayIcon. Since Electron came back, I haven't felt or heard of the need to use snixembed.

The specifications are important for Wayland window managers, since obviously XEmbed doesn't work there. I believe sway has a clean implementation which can be used as a reference in case you want to go ahead with implementing it. It should become widespread at some point, but I think the question is still a bit: which one of the two? (But if you do end up implementing SNI, feel free to shoot if something is weird, I've encountered some weirdness along the way)

@psychon
Copy link
Member

psychon commented Aug 28, 2020

@steef435 Thanks a lot for this information. Since I am not sure how I would test my implementation (and yesterday ate up my motivation to work on this), I am not going to work on this any time soon.

Bottom line though, is that it's probably not too important to support either specification for now.

Yay 🎉

@HIDE-r
Copy link

HIDE-r commented Jan 11, 2023

https://git.sr.ht/~steef/snixembed allows you to proxy StatusNotifierItems as XEmbedded systemtray-spec icons. It worked for me riot client icon re-appeared.

When I run the snixembed, I found that Electron software's icon is bigger than original icon, and some icon also have transparency. That look so ugly, so have any method can reslove it? If anyone can help, will be very grateful !!!

Before snixembed:
image

After snixembed:
image

I run the iwgtk -i, so you can see the wifi logo when after run snixembed.


Before snixembed:
The keyboard icon is white.
image

After snixembed:
The keyboard icon is transparency
image

@actionless
Copy link
Member

@HideOnLie how the icons look when using different panel with systray, not AwesomeWM's?

@HIDE-r
Copy link

HIDE-r commented Jan 12, 2023

@HideOnLie how the icons look when using different panel with systray, not AwesomeWM's?

I had try the stalonetray. It also have the same problem.

  1. run stalonetray:
    image

  2. run snixembed:
    image

icon will become more bigger, and some icon's theme had change.

@actionless
Copy link
Member

actionless commented Jan 12, 2023

It also have the same problem.

then obviously the problem is on the side of icon or icon-rendering routine of those apps, not AwesomeWM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants