Using org.freedesktop.timedate1 to provide datetime settings
yetist opened this issue · 3 comments
yetist commented
The datetime plugin of mate-settings-daemon implements a DBUS service to set the system time / timezone as follows:
$ gdbus introspect --system --dest org.mate.SettingsDaemon.DateTimeMechanism --object-path /
node / {
interface org.freedesktop.DBus.Introspectable {
methods:
Introspect(out s data);
signals:
properties:
};
interface org.freedesktop.DBus.Properties {
methods:
Get(in s interface,
in s propname,
out v value);
Set(in s interface,
in s propname,
in v value);
GetAll(in s interface,
out a{sv} props);
signals:
properties:
};
interface org.mate.SettingsDaemon.DateTimeMechanism {
methods:
SetHardwareClockUsingUtc(in b is_using_utc);
GetHardwareClockUsingUtc(out b is_using_utc);
AdjustTime(in x seconds_to_add);
CanSetTime(out i value);
SetTime(in x seconds_since_epoch);
CanSetTimezone(out i value);
GetTimezone(out s timezone);
SetTimezone(in s zonefile);
signals:
properties:
};
};
Systemd also implements a DBUS service to set up the system time as follows:
$ gdbus introspect --system --dest org.freedesktop.timedate1 --object-path /org/freedesktop/timedate1
node /org/freedesktop/timedate1 {
interface org.freedesktop.DBus.Peer {
methods:
Ping();
GetMachineId(out s machine_uuid);
signals:
properties:
};
interface org.freedesktop.DBus.Introspectable {
methods:
Introspect(out s data);
signals:
properties:
};
interface org.freedesktop.DBus.Properties {
methods:
Get(in s interface,
in s property,
out v value);
GetAll(in s interface,
out a{sv} properties);
Set(in s interface,
in s property,
in v value);
signals:
PropertiesChanged(s interface,
a{sv} changed_properties,
as invalidated_properties);
properties:
};
interface org.freedesktop.timedate1 {
methods:
SetTime(in x arg_0,
in b arg_1,
in b arg_2);
SetTimezone(in s arg_0,
in b arg_1);
SetLocalRTC(in b arg_0,
in b arg_1,
in b arg_2);
SetNTP(in b arg_0,
in b arg_1);
signals:
properties:
readonly s Timezone = 'Asia/Shanghai';
readonly b LocalRTC = false;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b CanNTP = true;
readonly b NTP = true;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly b NTPSynchronized = true;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t TimeUSec = 1528342832113233;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t RTCTimeUSec = 1528342832000000;
};
};
They provide the same function. Maybe we should use org.freedesktop.timedate1 dbus interface directly?
raveit65 commented
I think there are people who don't use systemd, but for the majority of distros/users it should be OK or better to use systemd directly, imho.
Maybe with a condition?
alexarnaud commented
Le 07/06/2018 à 10:24, raveit65 a écrit :
I think there are people who don't use systemd, but for the majority of
distros/users it should be OK or better to use systemd directly, imho.
Maybe with a condition?
I assume people using BSDs systems don't have systemd so if we would
like to be usable for all we don't have the choice to keep the old
function as fallback if systemd is not available.
Best regards,
Alex.
texstar commented