... | ... | @@ -108,6 +108,46 @@ sudo gdbus call --system \ |
|
|
|
|
|
See [this thread](https://forums.puri.sm/t/phone-call-api/8433) for context.
|
|
|
|
|
|
### Getting/Setting Screen Brightness
|
|
|
|
|
|
Introspect the GNOME Settings daemon to see what interfaces are available:
|
|
|
```
|
|
|
gdbus introspect --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power
|
|
|
```
|
|
|
|
|
|
The `org.gnome.SettingsDaemon.Power.Screen` interface is relevant:
|
|
|
```
|
|
|
interface org.gnome.SettingsDaemon.Power.Screen {
|
|
|
methods:
|
|
|
StepUp(out i new_percentage,
|
|
|
out i output_id);
|
|
|
StepDown(out i new_percentage,
|
|
|
out i output_id);
|
|
|
signals:
|
|
|
properties:
|
|
|
readwrite i Brightness = 29;
|
|
|
};
|
|
|
```
|
|
|
|
|
|
Get all properties related to the screen:
|
|
|
```
|
|
|
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.freedesktop.DBus.Properties.GetAll org.gnome.SettingsDaemon.Power.Screen
|
|
|
```
|
|
|
This should return something like the following:
|
|
|
```
|
|
|
({'Brightness': <29>},)
|
|
|
```
|
|
|
|
|
|
The brightness can be individually read:
|
|
|
```
|
|
|
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.freedesktop.DBus.Properties.Get org.gnome.SettingsDaemon.Power.Screen Brightness
|
|
|
```
|
|
|
|
|
|
It can also be set:
|
|
|
```
|
|
|
gdbus call --session --dest org.gnome.SettingsDaemon.Power --object-path /org/gnome/SettingsDaemon/Power --method org.freedesktop.DBus.Properties.Set org.gnome.SettingsDaemon.Power.Screen Brightness '<30>'
|
|
|
```
|
|
|
|
|
|
## Using Applications to Provide Services
|
|
|
|
|
|
GNOME applications run using the `--gapplication-service` command line option will expose the [org.freedesktop.Application](https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#dbus) interface on the session bus. This can be accessed to launch the application and request that it open files specified with URIs. The parameters of the API are explained by [this GApplication D-Bus APIs document](https://wiki.gnome.org/Projects/GLib/GApplication/DBusAPI) which refers to a different interface but which seems to overlap with the freedesktop interface.
|
... | ... | |