-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Is it possible to replace aw-watcher-window? #79
Comments
Oh, never mind. I found the |
@flexagoon I've already tried this, the D-Bus API is locked down in newer versions of gnome-shell, so only the xdg-desktop-gnome process is allowed to talk with it unless you fork the code. flatpak/xdg-desktop-portal#304 (comment) Long-term the best solution is probably to make an xdg-desktop-portal PR with a suggestion on an API and an PR to xdg-portal-gnome with an prototype implementation and then discuss further from there. |
I've done this for about 2 years with aw-watcher-window-wayland for phosh based compositors, works very well. |
@johan-bjareholt what do you mean? Other applications should be able to talk to D-Bus, otherwise there would be no point in D-Bus. And I'm not calling the "active window" API directly, I made an extension that wraps this in a different D-Bus query |
@flexagoon D-Bus is for inter process communication yes, but that does not mean that any application is allowed to talk to any D-Bus service due to security. And in this case, instead of using the normal D-Bus policyxml files for D-Bus permissions, they've hardcoded the permissions in the app so you can't change them without recompiling the app. The only process allowed to use the API is xdg-desktop-portal-gnome. This was stated in the link I sent earlier in the xdg-desktop-portal issue. |
What do you mean exactly? Which API are you using then? |
@johan-bjareholt the active window API can't be called by other apps due to security, but it can be called by GNOME Shell extensions. Extensions can also define their own DBus schemas, and apply their own security policies to them. So you can create an extension that defines a DBus function which everyone can call, and when that function gets called the extension runs the active window api and returns the result of that. |
Here's an example of an extension that exposes private APIs as public DBus queries |
Aha, that makes sense! In that case why even make a new watcher, why not try to integrate it straight into aw-watcher-window? |
Another option would be to just skip implementing an extension completely, and just re-use the window-calls extension. It already supports the List method which is all we need. |
@johan-bjareholt I already implemented the extension https://github.com/flexagoon/focused-window-dbus I also already made the watcher and I'm using it on my machine. I'll do some polishing and upload it to Github. I don't know any Rust though, so I'm not able to add it to aw-watcher-window-wayland myself unfortunately, you'll have to do this if you want to I also don't know whether GNOME supports idle.xml or not, I wasnt able to find any information on that. I just found that GNOME has a "time since last input" D-Bus query so I used that. |
@johan-bjareholt I released aw-watcher-gnome here: |
no workaround on plasma yet, right? |
@igorcafe awatcher supports plasma |
I use GNOME Wayland, and aw-watcher-window doesnt work on that, so I'm creating a simple GNOME extension that would get the active window title via GNOME's API, like in #46. The aw-client-js library can't be easily used in GJS, so the actual watcher will be made in Python and communitcate with the extension via D-Bus.
However, the question is, is it possible for users to replace aw-watcher-window? What I mean is some sort of a config to prevent aw-watcher-window from starting automatically and starting a custom version (eg. aw-watcher-window-gnome) instead.
The text was updated successfully, but these errors were encountered: