-
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'
Please register or sign in to comment