|
2 | 2 |
|
3 | 3 | from __future__ import annotations
|
4 | 4 |
|
5 |
| -from gi.repository.Gio import BusType, DBusProxy, DBusProxyFlags |
| 5 | +from time import sleep |
6 | 6 |
|
7 |
| -proxy = DBusProxy.new_for_bus_sync( |
8 |
| - BusType.SESSION, |
9 |
| - DBusProxyFlags.DO_NOT_LOAD_PROPERTIES, |
10 |
| - None, |
11 |
| - "org.freedesktop.systemd1", |
12 |
| - "/org/freedesktop/systemd1/unit/update_2dmotd_2etimer", |
13 |
| - "org.freedesktop.DBus.Properties", |
14 |
| - None, |
15 |
| -) |
| 7 | +from gi.repository.Gio import BusType, DBusProxy, DBusProxyFlags |
16 | 8 |
|
| 9 | +# print(proxy.GetAll("(ss)", "org.freedesktop.systemd1.Timer", "NextElapseUSecMonotonic")) # type: ignore |
17 | 10 |
|
18 |
| -print(proxy.GetAll("(ss)", "org.freedesktop.systemd1.Timer", "NextElapseUSecMonotonic")) # type: ignore |
19 | 11 |
|
20 |
| -print(proxy.Get("(ss)", "org.freedesktop.systemd1.Timer", "NextElapseUSecMonotonic")) # type: ignore |
| 12 | +while True: |
| 13 | + proxy = DBusProxy.new_for_bus_sync( |
| 14 | + BusType.SESSION, |
| 15 | + DBusProxyFlags.DO_NOT_LOAD_PROPERTIES, |
| 16 | + None, |
| 17 | + "org.freedesktop.systemd1", |
| 18 | + "/org/freedesktop/systemd1/unit/example_2dtimer_2etimer", |
| 19 | + "org.freedesktop.DBus.Properties", |
| 20 | + None, |
| 21 | + ) |
| 22 | + print(proxy.Get("(ss)", "org.freedesktop.systemd1.Timer", "NextElapseUSecRealtime")) # type: ignore |
| 23 | + sleep(10) |
0 commit comments