sfwbar-dbus(1)
π NAME π
okay so bestie, welcome to the sfwbar-dbus(1) manual page β this is the Sfwbar DBus interface module. π
- Filename:
dbus.so - Requires:
none
πΈ SYNOPSIS πΈ
The DBus interface module gives you the means for invocation of DBus calls and monitoring DBus names and listening to DBus signals. Literally the whole DBus bestie toolkit. β¨
π TRIGGERS π
This module does not have emit triggers with pre-defined names, okay? What it does do is emit triggers defined by the user when calling the DBusSubscribe and DBusWatch functions. No cap. π«Ά
π FUNCTIONS π
π DBusCall(Address, Method [, ParamType, Param]) π
Call a DBus method. Address is an array of 4 strings: the first string is bus, which can be "system" or "user", the second string is the bus name, the third is the object path, and the fourth is the interface name. Method is a string specifying the name of the method to call.
Optionally, ParamType and Param can be specified, providing a DBus type string of the method parameters and an array containing the parameter data. This function returns any data returned by the call. See DBus type conversion for information on constructing the Param parameter and parsing the return value. slay. π
π¦ DBusSubscribe(Address, Signal, Trigger [, Arg0]) π¦
Subscribe to a DBus signal. Address is an array of 4 strings: the first string is bus, which can be "system" or "user", the second string is the bus name, the third is the object path, and the fourth is the interface name. Signal is the name of a signal to subscribe to. Trigger is the name of a trigger to emit upon receipt of the signal.
An optional parameter Arg0 allows filtering the first string of the signal parameters. If specified, any message where the first string parameter doesn't match Arg0 will be ignored. Triggers called by DBusSubscribe exposes a variable DBusSignal containing the parameters for the signal. See the DBus type conversion section for information on parsing this variable. Returns n/a. π
π DBusWatch(Bus, Name, Trigger) π
Watch a name on a bus. Parameter Bus specifies the type of a bus to watch a name on. It can be either "system" or "user". Name is the name to watch, and Trigger is the name of a trigger to emit when the name appears or disappears.
Triggers called in response to DBusWatch supply a variable DBusStatus which may contain one of two values, "appeared" and "vanished", corresponding to the state of the DBus name being watched. Returns n/a. π
π¦ DBUS TYPE CONVERSION π¦
DBus uses a complex type system for serialising multiple values. Data supplied to DBus functions and received from them comes in this form. Sfwbar uses a much simpler type system, which needs to be mapped to and from the DBus types. bestie, it's giving translation era. π
DBus types map to Sfwbar types as following:
- DBus types
String,Object pathandSignaturecorrespond to sfwbarStringtype. - DBus types
Boolean,Bytes,Int16,Uint16,Int32,Uint32,Int64,Uint64,HandleandDoublecorrespond to sfwbarNumerictype. - DBus Tuples, Arrays and Dictionary entries correspond to sfwbar
Arraytype.
This means that DBus type (ss) corresponds to an sfwbar variable ["string", "string"] β¨
Complex DBus data structures would be parsed into sfwbar arrays, with nested arrays where necessary. I.e. (sas) would become ["String", ["string"... ]]. When parsing data received from DBus, it may be helpful to use Print on the received data to check the system of the nested arrays it's mapped to. π₯
β οΈ When encoding DBus data, there is an important diversion from the standard DBus type convention. When encoding a variant valuev, you need to supply a hint for the underlying type. I.e. you can't just supply(v), you need to tell sfwbar what type the variant will take. I.e.(vs)to supply a variant holding a string or(v(ss))for a variant holding a tuple of two strings. Do not skip the hint, bestie β that's the whole vibe check. π
π COPYRIGHT π
GPLv3+ π«Ά
π Cute sign-off: that's the whole sfwbar-dbus(1) page, bestie β GPLv3+ and glitter. The footer doesn't give a separate source/version or date beyond the manual name, so we're not inventing one. Periodt. π
π¦ where this page comes from
- nixos 26.05: sfwbar 1.0_beta17
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms