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

Add DBus interface #774

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from
Draft

Add DBus interface #774

wants to merge 12 commits into from

Conversation

Lythenas
Copy link
Collaborator

@Lythenas Lythenas commented Feb 3, 2024

(Partially) implements #738

Implements a basic DBus interface for PaperWM.

Functionality is pretty limited but still somewhat usable:

  • methods
    • allow triggering (parameterless) actions (i.e. keybindings)
    • list actions
    • activate a space by index
    • list spaces and get single space by index
  • signals
    • WindowAdded
  • properties
    • DebugTrace (currently does nothing, but I'm imagining turning on some tracing functionality (e.g. more signals) in the future. Sending many dbus messages/signals does have a performance impact.

Main points of interest:

  • dbus.js: implementation of the DBus interface
  • dbus/org.github.PaperWM.xml: definition of the DBus interface
  • dbus-send.sh and dbus-monitor.sh mainly for debugging output is not ideal to use for scripting and it can't currently call all methods

Testing Examples

  • ./dbus-monitor.sh --signals and open a new window
  • ./dbus-send.sh list-actions
  • ./dbus-send.sh action toggle-maximize-width (or other actions)

TODOs

  • write some documentation
  • (probably) provide a more convenient way to use
  • (probably) remove Eval and UndoEval

Open Questions

  • Are we allowed to provide our own Eval? In Gnome this is already available (similarly) but only enabled if you manually set global.context.unsafe_mode = true in looking glass.
  • How do we want to document this? I'm thinking just a separate md file.
  • Do we want to provide some more convenient way to use the DBus interface (e.g. js or python script/library)? The output of dbus-send is not very usable is bash scripts.

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

Successfully merging this pull request may close these issues.

1 participant