Skip to content

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.

@Thesola10 Thesola10 mentioned this pull request Jan 14, 2025
7 tasks
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