-
Notifications
You must be signed in to change notification settings - Fork 131
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
Add DBus interface to expose some actions/functions of PaperWM #738
Comments
@jtaala are there any guidelines about using DBus for EGO that we need to consider? |
Not only for that. It would greatly improve the accessibility and usability in multiple ways. Right now the functionality is available only through keyboard shortcuts allowed by GNOME for extensions. There are multiple cases where the possibility to call a function externally will be benefitial:
|
That's a very exciting evolution. |
Well, don't thank us yet - we still need to find someone to implement this... For me, this would be on the list but not a high priority. Would definitely accept a PR for this though for anyone that wants to give this a go. |
Not that I'm aware of. Only thing on extension guide is an intro to dbus and how to interact via dbus in extensions. No specific guidelines re dbus - there certainly was no issue (raised or questions asked) with our async dbus connector #577. |
I would be generally interested in implementing this. Especially this part to help debugging because sometimes it is really not clear to me what exact steps PaperWM takes^^
If I get time over Christmas I will try to implement a proof of concept. This might also help with #707 because I can't figure out why it triggers sometimes and sometimes not. |
I have been experimenting a bit with this and have some basics working. If Besides that exposing functions manually is mostly straight forward but requires some boilerplate. I will look into a way to generate some of the DBus interfaces from our existing actions/keybindings. I.e. simple function calls without arguments (like what keybindings would do). |
Is your feature request related to a problem? Please describe.
It is not possible to trigger PaperWM actions or call PaperWM functions using custom scripts or keybindings. This was made even less possible in Gnome 45 because we don't support a
user.js
anymore.This would be useful for users to more easily extend the functionality of PaperWM.
This came up in at least two other issues: #727, #730
Describe the solution you'd like
Add a DBus interface for (most) of the PaperWM functionality.
The scope of this should be discussed. Since all changes to the DBus interface would technically be a breaking changes for users. We should define clearly what to expose. I propose to start with the actions available as keybindings (since they are simple functions without arugments, etc.) and later expand on that.
Some way to dump or inspect the PaperWM state would also be useful for debugging or troubleshooting. We could later also add "monitor" functionality that can be used to trace "events" in PaperWM in more detail.
Exposing the entire "internal" PaperWM API might come with a lot of boilerplate (not sure if that could be generated) and I'm not sure if we really want to do that.
Gnome also has a DBus endpoint to run arbitrary JS code. We could provide something similar to access the internal PaperWM API. This might be easier than exposing everything manually. The Gnome DBus endpoint for this is only enabled in unsafe mode (which you can turn on in looking glass via
global.context.unsafe_mode = true
).Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: