Mechanix Desktop D-Bus Server
Overview
The Mechanix Desktop D-Bus Server is a background service that provides D-Bus interfaces for managing desktop-related features such as sound and power. It also includes a handler for idle notification. Built in Rust, it enables seamless communication between Mechanix OS components and desktop services.
Interfaces
The Mechanix Desktop D-Bus server exposes several interfaces for managing desktop features. These interfaces are used by client applications like the launcher and settings app to interact with the server and control desktop features. These methods can be accessed using the busctl
command-line tool or through D-Bus libraries in various programming languages. Proxies for these interfaces are available in the Mechanix Desktop D-Bus Client library built in Rust.
1. Sound Interface org.mechanix.services.Sound
Manages sound devices, including volume control, mute status, and device information.
Methods
-
Get Connected Input Devices
Description:
This method is used to retrieve a list of connected input devices.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound GetConnectedInputDevices
Returns:
- List of connected input devices.
- On failure, an error message is returned.
-
Get Connected Output Devices
Description:
This method is used to retrieve a list of connected output devices.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound GetConnectedOutputDevices
Returns:
- List of connected output devices.
- On failure, an error message is returned.
-
Get Input Device Volume
Description:
This method is used to retrieve the volume level of a specified input device.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound GetInputDeviceVolume s "<device>"
Returns:
- Volume level.
- On failure, an error message is returned.
-
Get Output Device Volume
Description:
This method is used to retrieve the volume level of a specified output device.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound GetOutputDeviceVolume s "<device>"
Returns:
- Volume level.
- On failure, an error message is returned.
-
Input Device Mute
Description:
This method is used to mute a specified input device.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound InputDeviceMute s "<device>"
Returns:
- On success, nothing is returned.
- On failure, an error message is returned.
-
Input Device Toggle Mute
Description:
This method is used to toggle the mute status of a specified input device.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound InputDeviceToggleMute s "<device>"
Returns:
- On success, nothing is returned.
- On failure, an error message is returned.
-
Input Device Unmute
Description:
This method is used to unmute a specified input device.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound InputDeviceUnmute s "<device>"
Returns:
- On success, nothing is returned.
- On failure, an error message is returned.
-
Output Device Mute
Description:
This method is used to mute a specified output device.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound OutputDeviceMute s "<device>"
Returns:
- On success, nothing is returned.
- On failure, an error message is returned.
-
Output Device Toggle Mute
Description:
This method is used to toggle the mute status of a specified output device.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound OutputDeviceToggleMute s "<device>"
Returns:
- On success, nothing is returned.
- On failure, an error message is returned.
-
Output Device Unmute
Description:
This method is used to unmute a specified output device.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound OutputDeviceUnmute s "<device>"
Returns:
- On success, nothing is returned.
- On failure, an error message is returned.
-
Set Input Device Volume
Description:
This method is used to set the volume level for a specified input device.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound SetInputDeviceVolume s "<volume>" "<device>"
Returns:
- On success, nothing is returned.
- On failure, an error message is returned.
-
Set Output Device Volume
Description:
This method is used to set the volume level for a specified output device.
Command:
busctl --system call org.mechanix.services.Sound /org/mechanix/services/Sound org.mechanix.services.Sound SetOutputDeviceVolume s "<volume>" "<device>"
Returns:
- On success, nothing is returned.
- On failure, an error message is returned.
Signals
-
Notification
Description:
This method is used to return a notification stream which client can subscribe to get sound-related events. The stream includes the following fields:is_mute
: Mute statusvolume_level
: Volume level
2. Power Interface org.mechanix.services.Power
Provides methods for managing system performance related settings.