waxedctl
waxedctl - Waxed Compositor Control Tool
Overview
waxedctl is the command-line interface for controlling and managing the Waxed display server. It communicates with the running compositor via a Unix domain socket, allowing you to manage plugins, modify properties, and invoke plugin APIs at runtime.
Key capabilities:
- Load and unload plugins dynamically
- Query plugin status and information
- Modify plugin properties via YAML syntax
- Invoke plugin-provided API calls
- Query compositor status
Installation and Location
waxedctl is built as part of the Waxed project and installed to the system binary directory. After building Waxed, the tool is available as:
waxedctl
The installed binary location depends on your CMake configuration, but typically installs to:
/usr/local/bin/waxedctl(default)/usr/bin/waxedctl(ifCMAKE_INSTALL_PREFIX=/usr)
Socket Communication
waxedctl communicates with the Waxed compositor via a Unix domain socket. The socket location is determined by the following priority:
-
Environment variable:
XDG_RUNTIME_DIR(recommended)- Default path:
$XDG_RUNTIME_DIR/waxed-ipc.sock
- Default path:
-
Fallback location: If
XDG_RUNTIME_DIRis not set- Path:
/tmp/waxed-<uid>.sock - Where
<uid>is your user ID
- Path:
-
Manual override: Use the
-sor--socketoptionwaxedctl -s /custom/path/socket.sock plugin list
Connection Requirements
- The Waxed compositor must be running
- The socket file must exist
- You must have read/write permissions on the socket
Command Syntax
waxedctl uses a hierarchical command structure with subcommands:
waxedctl [global-options] <subcommand> [subcommand-options] [arguments]
Global Options
| Option | Short | Description |
|---|---|---|
--socket | -s | Specify custom IPC socket path |
--help | -h | Show help message |
--version | -v | Show version information |
Subcommands
waxedctl organizes commands into logical groups:
Available Commands
Plugin Management
List Plugins
Display all currently loaded plugins:
waxedctl plugin list
Example output:
Loaded plugins:
- desktop
- loginscreen
- background
Load Plugin
Load a plugin by name:
waxedctl plugin load <name>
Example:
waxedctl plugin load loginscreen
Unload Plugin
Unload a plugin by name:
waxedctl plugin unload <name>
Example:
waxedctl plugin unload loginscreen
Show Plugin
Make a plugin visible (bring it to the foreground):
waxedctl plugin show <name>
Example:
waxedctl plugin show desktop
Property Manipulation
Properties are stored as YAML configurations within plugins. The property commands allow you to modify these configurations at runtime.
Set Property
Set a property value on a plugin:
waxedctl property set <plugin> -y <key>:<value>
Format: The -y flag takes a colon-separated key:value pair. For nested keys, use additional colons.
Examples:
# Set background image
waxedctl property set loginscreen -y background:/path/to/image.jpg
# Set nested property
waxedctl property set desktop -y opacity:0.8
# Set multiple-level nested property
waxedctl property set plugin -y section:subsection:value
Get Property
Query a property value from a plugin:
waxedctl property get <plugin> -y <key>
Example:
waxedctl property get loginscreen -y background
List Properties
List all properties of a plugin:
waxedctl property list <plugin> [-y <namespace>]
The -y flag specifies the namespace (defaults to “yaml”).
Example:
waxedctl property list loginscreen
API Operations
Plugins can register API functions that can be invoked via waxedctl.
List APIs
Display all registered API calls:
waxedctl api list
Example output:
Registered APIs:
- surface_create <x> <y> <width> <height>
- surface_move <id> <x> <y>
- surface_resize <id> <width> <height>
- layer_list
Execute API Call
Invoke a plugin API:
waxedctl api <name> [args...]
Examples:
# Create a surface
waxedctl api surface_create 100 100 800 600
# List layers
waxedctl api layer_list
# Move a surface
waxedctl api surface_move 5 200 150
Status Query
Query the compositor status:
waxedctl status
Example output:
Waxed Compositor Status
Version: 1.0.0
Uptime: 2 hours 15 minutes
Active plugins: 3
Response Format
waxedctl receives responses from the compositor in the following text-based protocol format:
<status_code>\n
<message>\n
[optional data lines...]
Status Codes
| Code | Name | Description |
|---|---|---|
| 0 | Success | Command completed successfully |
| 1 | Error | General error occurred |
| 2 | NotFound | Requested resource not found |
| 3 | InvalidCommand | Command syntax is invalid |
| 4 | PermissionDenied | Insufficient permissions |
Response Examples
Success response:
0
Plugin loaded successfully
desktop: active
Error response:
2
Plugin not found
Error Handling
waxedctl provides detailed error messages for common failure scenarios:
Connection Errors
Failed to connect to socket at /run/user/1000/waxed-ipc.sock
Connection refused
Possible reasons:
- Waxed compositor is not running
- Socket file does not exist
- Insufficient permissions
Resolution:
- Verify Waxed is running:
ps aux | grep waxed - Check socket exists:
ls -la $XDG_RUNTIME_DIR/waxed-ipc.sock - Verify permissions: The socket should be readable/writable by your user
Command Errors
1
Plugin 'loginscreen' not found
Resolution:
- Check available plugins:
waxedctl plugin list - Verify plugin name spelling
Property Errors
1
Invalid property format. Use 'key:value' syntax.
Resolution:
- Ensure you’re using the correct
key:valueformat with the-yflag - Check that the property exists in the plugin’s configuration
Example Usage Sessions
Session 1: Basic Plugin Management
# List current plugins
$ waxedctl plugin list
Loaded plugins:
- desktop
# Load the loginscreen plugin
$ waxedctl plugin load loginscreen
Plugin loaded successfully
# Verify it's loaded
$ waxedctl plugin list
Loaded plugins:
- desktop
- loginscreen
Session 2: Configuring Properties
# Change the login screen background
$ waxedctl property set loginscreen -y background:/usr/share/backgrounds/nature.jpg
Property updated successfully
# Verify the change
$ waxedctl property get loginscreen -y background
/usr/share/backgrounds/nature.jpg
# List all properties
$ waxedctl property list loginscreen
Properties in 'yaml' namespace:
background: /usr/share/backgrounds/nature.jpg
opacity: 1.0
blur_radius: 20
Session 3: API Interaction
# List available APIs
$ waxedctl api list
Registered APIs:
- surface_create <x> <y> <width> <height>
- layer_list
# Create a new surface
$ waxedctl api surface_create 100 100 800 600
Surface created with ID: 42
# List layers
$ waxedctl api layer_list
Layer 0: background
Layer 1: desktop
Layer 2: surfaces
Session 4: Dynamic Reloading
# Unload a plugin
$ waxedctl plugin unload background
Plugin unloaded successfully
# Reload it
$ waxedctl plugin load background
Plugin loaded successfully
# Make it visible
$ waxedctl plugin show background
Plugin is now visible
Integration with Compositor
IPC Architecture
Command Flow
Protocol Details
The IPC protocol uses text-based commands for human-readability:
| Command | Protocol String | Description |
|---|---|---|
| List plugins | list | Get all loaded plugins |
| Load plugin | plugin:<name> load | Load specified plugin |
| Unload plugin | plugin:<name> unload | Unload specified plugin |
| Show plugin | plugin:<name> show | Make plugin visible |
| Set property | plugin:<name> yaml:<key>:<value> | Set property value |
| Get property | plugin:<name> yaml:get:<key> | Get property value |
| List properties | plugin:<name> yaml:list | List all properties |
| API list | api list | List registered APIs |
| API call | api <name> [args...] | Execute API function |
| Status | status | Query compositor status |
| Help | help | Show help text |
Plugin Integration
Plugins integrate with waxedctl through the core API:
- Registration: Plugins register themselves with the PluginManager
- Properties: Each plugin has a YAML property store
- API Functions: Plugins can register callable API functions
- Lifecycle: Plugins can be loaded/unloaded at runtime
Security Considerations
- Socket permissions: Only the user running Waxed can access the socket
- No authentication: The tool assumes local access equates to authorized use
- Property validation: Plugins should validate property values before applying
Sequence Diagrams
Complete Command Flow
Socket Location Resolution
Property Set Command Breakdown
Tips and Best Practices
-
Check socket location if commands fail:
echo $XDG_RUNTIME_DIR/waxed-ipc.sock ls -la $XDG_RUNTIME_DIR/waxed-ipc.sock -
Use tab completion - Many shells support completion for waxedctl subcommands
-
Query before modifying - Always check current values with
property getbefore setting new ones -
List available APIs - Use
api listto see what functions are available before calling them -
Test property changes - Some plugins reload configuration on change, others may require a reload
-
Check logs - If commands fail, check the Waxed compositor logs for detailed error messages
Troubleshooting
| Symptom | Cause | Solution |
|---|---|---|
| ”Failed to connect” | Compositor not running | Start Waxed compositor |
| ”Socket file does not exist” | Wrong socket path | Use -s flag with correct path |
| ”Permission denied” | Wrong user | Run as same user as compositor |
| ”Plugin not found” | Plugin not loaded | Use plugin load first |
| ”Property not found” | Invalid key | Use property list to find valid keys |
| ”Invalid command syntax” | Wrong argument format | Check command syntax with -h |