readonly s Hostname = '...';
readonly s StaticHostname = '...';
readonly s PrettyHostname = '...';
+ @org.freedesktop.DBus.Property.EmitsChangedSignal("const")
+ readonly s FallbackHostname = '...';
readonly s IconName = '...';
readonly s Chassis = '...';
readonly s Deployment = '...';
<variablelist class="dbus-property" generated="True" extra-ref="PrettyHostname"/>
+ <variablelist class="dbus-property" generated="True" extra-ref="FallbackHostname"/>
+
<variablelist class="dbus-property" generated="True" extra-ref="IconName"/>
<variablelist class="dbus-property" generated="True" extra-ref="Chassis"/>
set this setting will be the empty string. Applications should then find a suitable fallback, such as the
dynamic hostname.</para>
+ <para>The <varname>FallbackHostname</varname> property exposes the fallback hostname (configured at
+ compilation time).</para>
+
<para>The <varname>IconName</varname> property exposes the <emphasis>icon name</emphasis> following the
XDG icon naming spec. If not set, information such as the chassis type (see below) is used to find a
suitable fallback icon name (i.e. <literal>computer-laptop</literal>
#include "alloc-util.h"
#include "bus-common-errors.h"
+#include "bus-get-properties.h"
#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "def.h"
return sd_bus_message_append(reply, "s", c->data[PROP_STATIC_HOSTNAME]);
}
+static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_fallback_hostname, "s", FALLBACK_HOSTNAME);
+
static int property_get_machine_info_field(
sd_bus *bus,
const char *path,
SD_BUS_PROPERTY("Hostname", "s", property_get_hostname, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("StaticHostname", "s", property_get_static_hostname, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("PrettyHostname", "s", property_get_machine_info_field, offsetof(Context, data) + sizeof(char*) * PROP_PRETTY_HOSTNAME, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
+ SD_BUS_PROPERTY("FallbackHostname", "s", property_get_fallback_hostname, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("IconName", "s", property_get_icon_name, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Chassis", "s", property_get_chassis, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("Deployment", "s", property_get_machine_info_field, offsetof(Context, data) + sizeof(char*) * PROP_DEPLOYMENT, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),