Skip to content
  • With Python we can do better:

    >>> import gi
    >>> gi.require_version('GLib', '2.0')
    >>> gi.require_version('Gio', '2.0')
    >>> from gi.repository import GLib, Gio
    >>> bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
    >>> proxy = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None, 'org.freedesktop.Accounts', '/org/freedesktop/Accounts', 'org.freedesktop.Accounts', None)
    >>> path = proxy.FindUserByName('(s)', GLib.get_user_name())
    >>> path
    '/org/freedesktop/Accounts/User1000'
    >>> proxy = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None, 'org.freedesktop.Accounts', path, 'org.freedesktop.DBus.Properties', None)
    >>> prop = proxy.Get('(ss)', 'org.freedesktop.Accounts.User', 'IconFile')
    >>> prop
    '/var/lib/AccountsService/icons/olivierd'
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment