Expand description
A block controlled by the DBus
This block creates a new DBus object in rs.i3status
service. This object implements
rs.i3status.custom
interface which allows you to set block’s icon, text and state.
Output of busctl --user introspect rs.i3status /<path> rs.i3status.custom
:
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
rs.i3status.custom interface - - -
.SetIcon method s s -
.SetState method s s -
.SetText method ss s -
§Configuration
Key | Values | Default |
---|---|---|
format | A string to customise the output of this block. | "{ $icon|}{ $text.pango-str()|} " |
Placeholder | Value | Type | Unit |
---|---|---|---|
icon | Value of icon set via SetIcon if the value is non-empty string. | Icon | - |
text | Value of the first string from SetText | Text | - |
short_text | Value of the second string from SetText | Text | - |
§Example
Config:
[[block]]
block = "custom_dbus"
path = "/my_path"
Usage:
# set full text to 'hello' and short text to 'hi'
busctl --user call rs.i3status /my_path rs.i3status.custom SetText ss hello hi
# set icon to 'music'
busctl --user call rs.i3status /my_path rs.i3status.custom SetIcon s music
# set state to 'good'
busctl --user call rs.i3status /my_path rs.i3status.custom SetState s good
Because it’s impossible to publish objects to the same name from different
processes, having multiple dbus blocks in different bars won’t work. As a workaround,
you can set the env var I3RS_DBUS_NAME
to set the interface a bar works on to
differentiate between different processes. For example, setting this to ‘top’, will allow you
to use rs.i3status.top
.
§TODO
- Send a signal on click?