Backport Orca's d-bus remote fixes.
This commit is contained in:
@@ -11,7 +11,7 @@ This document lists the currently available D-Bus commands in Cthulhu's Remote C
|
||||
|
||||
## Service-Level Commands
|
||||
|
||||
Available on the main service object `/org/stormux/Cthulhu/Service`:
|
||||
Available on the main service object `/org/stormux/Cthulhu1/Service`:
|
||||
|
||||
### Service Commands
|
||||
|
||||
@@ -21,40 +21,37 @@ Available on the main service object `/org/stormux/Cthulhu/Service`:
|
||||
| `PresentMessage` | Present a message via speech/braille | `message` (string) | Boolean (success) |
|
||||
| `ShowPreferences` | Opens Cthulhu's preferences GUI | None | Boolean (success) |
|
||||
| `Quit` | Exits Cthulhu | None | Boolean (accepted) |
|
||||
| `ListCommands` | Lists available service commands | None | List of (name, description) tuples |
|
||||
| `ListModules` | Lists registered D-Bus modules | None | List of module names |
|
||||
|
||||
### Example Usage
|
||||
|
||||
```bash
|
||||
# Get Cthulhu version
|
||||
busctl --user call org.stormux.Cthulhu.Service /org/stormux/Cthulhu/Service \
|
||||
org.stormux.Cthulhu.Service GetVersion
|
||||
busctl --user call org.stormux.Cthulhu1.Service /org/stormux/Cthulhu1/Service \
|
||||
org.stormux.Cthulhu1.Service GetVersion
|
||||
|
||||
# Present a custom message
|
||||
busctl --user call org.stormux.Cthulhu.Service /org/stormux/Cthulhu/Service \
|
||||
org.stormux.Cthulhu.Service PresentMessage s "Hello from D-Bus"
|
||||
|
||||
# List available commands
|
||||
busctl --user call org.stormux.Cthulhu.Service /org/stormux/Cthulhu/Service \
|
||||
org.stormux.Cthulhu.Service ListCommands
|
||||
|
||||
# List registered modules
|
||||
busctl --user call org.stormux.Cthulhu.Service /org/stormux/Cthulhu/Service \
|
||||
org.stormux.Cthulhu.Service ListModules
|
||||
busctl --user call org.stormux.Cthulhu1.Service /org/stormux/Cthulhu1/Service \
|
||||
org.stormux.Cthulhu1.Service PresentMessage s "Hello from D-Bus"
|
||||
|
||||
# Open preferences
|
||||
busctl --user call org.stormux.Cthulhu.Service /org/stormux/Cthulhu/Service \
|
||||
org.stormux.Cthulhu.Service ShowPreferences
|
||||
busctl --user call org.stormux.Cthulhu1.Service /org/stormux/Cthulhu1/Service \
|
||||
org.stormux.Cthulhu1.Service ShowPreferences
|
||||
|
||||
# Quit Cthulhu
|
||||
busctl --user call org.stormux.Cthulhu.Service /org/stormux/Cthulhu/Service \
|
||||
org.stormux.Cthulhu.Service Quit
|
||||
busctl --user call org.stormux.Cthulhu1.Service /org/stormux/Cthulhu1/Service \
|
||||
org.stormux.Cthulhu1.Service Quit
|
||||
```
|
||||
|
||||
## Module-Level Commands
|
||||
|
||||
Module-level commands are available and can be discovered via `ListModules`. Two key additions are:
|
||||
Module-level commands and properties are discovered with standard DBus introspection:
|
||||
|
||||
```bash
|
||||
gdbus introspect --session --dest org.stormux.Cthulhu1.Service \
|
||||
--object-path /org/stormux/Cthulhu1/Service --recurse
|
||||
```
|
||||
|
||||
Two key additions are:
|
||||
|
||||
### PluginSystemManager
|
||||
|
||||
@@ -62,8 +59,8 @@ Session-only plugin control (does not persist preferences):
|
||||
|
||||
- `ListPlugins`
|
||||
- `ListActivePlugins`
|
||||
- `IsPluginActive` (parameterized)
|
||||
- `SetPluginActive` (parameterized)
|
||||
- `IsPluginActive`
|
||||
- `SetPluginActive`
|
||||
- `RescanPlugins`
|
||||
|
||||
### Plugin Modules
|
||||
@@ -73,31 +70,30 @@ convention `Plugin_<ModuleName>` (e.g., `Plugin_GameMode`, `Plugin_WindowTitleRe
|
||||
|
||||
#### WindowTitleReader (Plugin_WindowTitleReader)
|
||||
|
||||
- `SetEnabled` (parameterized) -> enabled (bool)
|
||||
- `Enabled` (runtime getter)
|
||||
- `SetEnabled` -> enabled (bool), notify_user (bool)
|
||||
- `Enabled` (property)
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
gdbus call --session --dest org.stormux.Cthulhu.Service \
|
||||
--object-path /org/stormux/Cthulhu/Service/Plugin_WindowTitleReader \
|
||||
--method org.stormux.Cthulhu.Module.ExecuteParameterizedCommand \
|
||||
'SetEnabled' '{"enabled": <true>}' false
|
||||
gdbus call --session --dest org.stormux.Cthulhu1.Service \
|
||||
--object-path /org/stormux/Cthulhu1/Service/Plugin_WindowTitleReader \
|
||||
--method org.stormux.Cthulhu1.Plugin_WindowTitleReader.SetEnabled true false
|
||||
```
|
||||
|
||||
Busctl example:
|
||||
|
||||
```bash
|
||||
busctl --user call org.stormux.Cthulhu.Service \
|
||||
/org/stormux/Cthulhu/Service/Plugin_WindowTitleReader \
|
||||
org.stormux.Cthulhu.Module ExecuteParameterizedCommand \
|
||||
s a{sv} b 'SetEnabled' 1 enabled b true false
|
||||
busctl --user call org.stormux.Cthulhu1.Service \
|
||||
/org/stormux/Cthulhu1/Service/Plugin_WindowTitleReader \
|
||||
org.stormux.Cthulhu1.Plugin_WindowTitleReader SetEnabled bb true false
|
||||
```
|
||||
|
||||
# Check current state
|
||||
busctl --user call org.stormux.Cthulhu.Service \
|
||||
/org/stormux/Cthulhu/Service/Plugin_WindowTitleReader \
|
||||
org.stormux.Cthulhu.Module ExecuteRuntimeGetter s 'Enabled'
|
||||
busctl --user call org.stormux.Cthulhu1.Service \
|
||||
/org/stormux/Cthulhu1/Service/Plugin_WindowTitleReader \
|
||||
org.freedesktop.DBus.Properties Get ss \
|
||||
org.stormux.Cthulhu1.Plugin_WindowTitleReader Enabled
|
||||
|
||||
See [README-REMOTE-CONTROLLER.md](README-REMOTE-CONTROLLER.md) for comprehensive D-Bus API documentation and usage examples.
|
||||
|
||||
@@ -107,11 +103,15 @@ See [README-REMOTE-CONTROLLER.md](README-REMOTE-CONTROLLER.md) for comprehensive
|
||||
# Check if Cthulhu's D-Bus service is running
|
||||
busctl --user list | grep Cthulhu
|
||||
|
||||
# Introspect the service to see all available methods
|
||||
busctl --user introspect org.stormux.Cthulhu.Service /org/stormux/Cthulhu/Service
|
||||
# Introspect the service to see available module nodes
|
||||
busctl --user introspect org.stormux.Cthulhu1.Service /org/stormux/Cthulhu1/Service
|
||||
|
||||
# Introspect a module to see its methods and properties
|
||||
busctl --user introspect org.stormux.Cthulhu1.Service \
|
||||
/org/stormux/Cthulhu1/Service/Plugin_WindowTitleReader
|
||||
|
||||
# Get detailed service information
|
||||
busctl --user status org.stormux.Cthulhu.Service
|
||||
busctl --user status org.stormux.Cthulhu1.Service
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Reference in New Issue
Block a user