{
    "content": [
        {
            "type": "text",
            "text": "# gdbus (man)\n\n## NAME\n\ngdbus - Tool for working with D-Bus objects\n\n## SYNOPSIS\n\ngdbus introspect [--system | --session | --address address] --dest busname\n--object-path /path/to/object [--xml] [--recurse] [--only-properties]\ngdbus monitor [--system | --session | --address address] --dest busname\n[--object-path /path/to/object]\ngdbus call [--system | --session | --address address] --dest busname\n--object-path /path/to/object --method org.project.InterfaceName.MethodName\n[--timeout seconds | --interactive] ARG1 ARG2...\ngdbus emit [--system | --session | --address address] --object-path /path/to/object\n--signal org.project.InterfaceName.SignalName [--dest uniquebusname] ARG1 ARG2...\ngdbus wait [--system | --session | --address address] --activate busname [--timeout seconds]\nbusname\ngdbus help\n\n## DESCRIPTION\n\ngdbus is a simple tool for working with D-Bus objects.\n\n## TLDR\n\n> Interact with D-Bus objects.\n\n- List all names on the session bus:\n  `gdbus list-names --session`\n- List all names on the system bus:\n  `gdbus list-names --system`\n- Introspect an object to see its interfaces and methods:\n  `gdbus introspect --session --dest {{destination_bus_name}} --object-path /{{path/to/object}}`\n- Call a method on an object with arguments:\n  `gdbus call --session --dest {{destination_bus_name}} --object-path /{{path/to/object}} --method {{interface.method_name}} {{argument1 argument2 ...}}`\n- Emit a signal from an object with arguments:\n  `gdbus emit --session --object-path /{{path/to/object}} --signal {{interface.signal_name}} {{argument1 argument2 ...}}`\n- Monitor all messages on the session bus:\n  `gdbus monitor --session`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **COMMANDS** (6 subsections)\n- **BASH COMPLETION**\n- **EXAMPLES**\n- **BUGS**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "gdbus",
        "section": "",
        "mode": "man",
        "summary": "gdbus - Tool for working with D-Bus objects",
        "synopsis": "gdbus introspect [--system | --session | --address address] --dest busname\n--object-path /path/to/object [--xml] [--recurse] [--only-properties]\ngdbus monitor [--system | --session | --address address] --dest busname\n[--object-path /path/to/object]\ngdbus call [--system | --session | --address address] --dest busname\n--object-path /path/to/object --method org.project.InterfaceName.MethodName\n[--timeout seconds | --interactive] ARG1 ARG2...\ngdbus emit [--system | --session | --address address] --object-path /path/to/object\n--signal org.project.InterfaceName.SignalName [--dest uniquebusname] ARG1 ARG2...\ngdbus wait [--system | --session | --address address] --activate busname [--timeout seconds]\nbusname\ngdbus help",
        "tldr_summary": "Interact with D-Bus objects.",
        "tldr_examples": [
            {
                "description": "List all names on the session bus",
                "command": "gdbus list-names --session"
            },
            {
                "description": "List all names on the system bus",
                "command": "gdbus list-names --system"
            },
            {
                "description": "Introspect an object to see its interfaces and methods",
                "command": "gdbus introspect --session --dest {{destination_bus_name}} --object-path /{{path/to/object}}"
            },
            {
                "description": "Call a method on an object with arguments",
                "command": "gdbus call --session --dest {{destination_bus_name}} --object-path /{{path/to/object}} --method {{interface.method_name}} {{argument1 argument2 ...}}"
            },
            {
                "description": "Emit a signal from an object with arguments",
                "command": "gdbus emit --session --object-path /{{path/to/object}} --signal {{interface.signal_name}} {{argument1 argument2 ...}}"
            },
            {
                "description": "Monitor all messages on the session bus",
                "command": "gdbus monitor --session"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [
            "This shows how to introspect an object - note that the value of each",
            "property is displayed:",
            "$ gdbus introspect --system \\",
            "--dest org.freedesktop.NetworkManager \\",
            "--object-path /org/freedesktop/NetworkManager/Devices/0",
            "node /org/freedesktop/NetworkManager/Devices/0 {",
            "interface org.freedesktop.DBus.Introspectable {",
            "methods:",
            "Introspect(out s data);",
            "};",
            "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);",
            "};",
            "interface org.freedesktop.NetworkManager.Device.Wired {",
            "signals:",
            "PropertiesChanged(a{sv} arg0);",
            "properties:",
            "readonly b Carrier = false;",
            "readonly u Speed = 0;",
            "readonly s HwAddress = '00:1D:72:88:BE:97';",
            "};",
            "interface org.freedesktop.NetworkManager.Device {",
            "methods:",
            "Disconnect();",
            "signals:",
            "StateChanged(u arg0,",
            "u arg1,",
            "u arg2);",
            "properties:",
            "readonly u DeviceType = 1;",
            "readonly b Managed = true;",
            "readwrite o Ip6Config = '/';",
            "readwrite o Dhcp4Config = '/';",
            "readwrite o Ip4Config = '/';",
            "readonly u State = 2;",
            "readwrite u Ip4Address = 0;",
            "readonly u Capabilities = 3;",
            "readonly s Driver = 'e1000e';",
            "readwrite s Interface = 'eth0';",
            "readonly s Udi = '/sys/devices/pci0000:00/0000:00:19.0/net/eth0';",
            "};",
            "};",
            "The --recurse and --only-properties options can be useful when wanting to inspect all objects",
            "owned by a particular process:",
            "$ gdbus introspect --system --dest org.freedesktop.UPower --object-path / --recurse  --only-properties",
            "node / {",
            "node /org {",
            "node /org/freedesktop {",
            "node /org/freedesktop/UPower {",
            "interface org.freedesktop.UPower {",
            "properties:",
            "readonly b IsDocked = true;",
            "readonly b LidForceSleep = false;",
            "readonly b LidIsPresent = false;",
            "readonly b LidIsClosed = false;",
            "readonly b OnLowBattery = false;",
            "readonly b OnBattery = false;",
            "readonly b CanHibernate = true;",
            "readonly b CanSuspend = true;",
            "readonly s DaemonVersion = '0.9.10';",
            "};",
            "node /org/freedesktop/UPower/Policy {",
            "};",
            "node /org/freedesktop/UPower/Wakeups {",
            "interface org.freedesktop.UPower.Wakeups {",
            "properties:",
            "readonly b HasCapability = true;",
            "};",
            "};",
            "};",
            "};",
            "};",
            "};",
            "In a similar fashion, the introspect command can be used to learn details about the Notify",
            "method:",
            "[...]",
            "interface org.freedesktop.Notifications {",
            "methods:",
            "GetServerInformation(out s returnname,",
            "out s returnvendor,",
            "out s returnversion,",
            "out s returnspecversion);",
            "GetCapabilities(out as returncaps);",
            "CloseNotification(in  u id);",
            "Notify(in  s appname,",
            "in  u id,",
            "in  s icon,",
            "in  s summary,",
            "in  s body,",
            "in  as actions,",
            "in  a{sv} hints,",
            "in  i timeout,",
            "out u returnid);",
            "};",
            "[...]",
            "With this information, it's easy to use the call command to display a notification",
            "$ gdbus call --session \\",
            "--dest org.freedesktop.Notifications \\",
            "--object-path /org/freedesktop/Notifications \\",
            "--method org.freedesktop.Notifications.Notify \\",
            "myappname \\",
            "42 \\",
            "gtk-dialog-info \\",
            "\"The Summary\" \\",
            "\"Here's the body of the notification\" \\",
            "[] \\",
            "{} \\",
            "5000",
            "(uint32 12,)",
            "Call a method with file handle argument:",
            "$ gdbus call --session \\",
            "--dest org.example.foo \\",
            "--object-path /org/example/foo \\",
            "--method SendFDs \\",
            "1 \\",
            "10 \\",
            "10<file.foo",
            "Monitoring all objects on a service:",
            "$ gdbus monitor --system --dest org.freedesktop.ConsoleKit",
            "Monitoring signals from all objects owned by org.freedesktop.ConsoleKit",
            "The name org.freedesktop.ConsoleKit is owned by :1.15",
            "/org/freedesktop/ConsoleKit/Session2: org.freedesktop.ConsoleKit.Session.ActiveChanged (false,)",
            "/org/freedesktop/ConsoleKit/Seat1: org.freedesktop.ConsoleKit.Seat.ActiveSessionChanged ('',)",
            "/org/freedesktop/ConsoleKit/Session2: org.freedesktop.ConsoleKit.Session.ActiveChanged (true,)",
            "/org/freedesktop/ConsoleKit/Seat1: org.freedesktop.ConsoleKit.Seat.ActiveSessionChanged ('/org/freedesktop/ConsoleKit/Session2',)",
            "Monitoring a single object on a service:",
            "$ gdbus monitor --system --dest org.freedesktop.NetworkManager --object-path /org/freedesktop/NetworkManager/AccessPoint/4141",
            "Monitoring signals on object /org/freedesktop/NetworkManager/AccessPoint/4141 owned by org.freedesktop.NetworkManager",
            "The name org.freedesktop.NetworkManager is owned by :1.5",
            "/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x5c>},)",
            "/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x64>},)",
            "/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x5e>},)",
            "/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x64>},)",
            "Emitting a signal:",
            "$ gdbus emit --session --object-path /foo --signal org.bar.Foo \"['foo', 'bar', 'baz']\"",
            "Emitting a signal to a specific process:",
            "$ gdbus emit --session --object-path /bar --signal org.bar.Bar someString --dest :1.42",
            "Waiting for a well-known name to be owned on the bus; this will not auto-start the service:",
            "$ gdbus wait --session org.bar.SomeName",
            "Auto-starting then waiting for a well-known name to be owned on the bus:",
            "$ gdbus wait --session --activate org.bar.SomeName",
            "Auto-starting a different service, then waiting for a well-known name to be owned on the bus.",
            "This is useful in situations where SomeName is not directly activatable:",
            "$ gdbus wait --session --activate org.bar.PrerequisiteName org.bar.SomeName",
            "Waiting for a well-known name and giving up after 30 seconds. By default, the timeout is",
            "disabled; or set --timeout to 0 to disable it:",
            "$ gdbus wait --session --timeout 30 org.bar.SomeName"
        ],
        "see_also": [
            {
                "name": "dbus-send",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/dbus-send/1/json"
            },
            {
                "name": "GDBUS",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/GDBUS/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COMMANDS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "introspect",
                        "lines": 7
                    },
                    {
                        "name": "monitor",
                        "lines": 2
                    },
                    {
                        "name": "call",
                        "lines": 4
                    },
                    {
                        "name": "emit",
                        "lines": 3
                    },
                    {
                        "name": "wait",
                        "lines": 4
                    },
                    {
                        "name": "help",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "BASH COMPLETION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 181,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "gdbus - Tool for working with D-Bus objects\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "gdbus introspect [--system | --session | --address address] --dest busname\n--object-path /path/to/object [--xml] [--recurse] [--only-properties]\n\ngdbus monitor [--system | --session | --address address] --dest busname\n[--object-path /path/to/object]\n\ngdbus call [--system | --session | --address address] --dest busname\n--object-path /path/to/object --method org.project.InterfaceName.MethodName\n[--timeout seconds | --interactive] ARG1 ARG2...\n\ngdbus emit [--system | --session | --address address] --object-path /path/to/object\n--signal org.project.InterfaceName.SignalName [--dest uniquebusname] ARG1 ARG2...\n\ngdbus wait [--system | --session | --address address] --activate busname [--timeout seconds]\nbusname\n\ngdbus help\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "gdbus is a simple tool for working with D-Bus objects.\n",
                "subsections": []
            },
            "COMMANDS": {
                "content": "",
                "subsections": [
                    {
                        "name": "introspect",
                        "content": "Prints out interfaces and property values for a remote object. For this to work, the\nowner of the object needs to implement the org.freedesktop.DBus.Introspectable interface.\nIf the --xml option is used, the returned introspection XML is printed, otherwise a\nparsed pretty representation is printed. The --recurse option can be used to introspect\nchildren (and their children and so on) and the --only-properties option can be used to\nonly print the interfaces with properties.\n"
                    },
                    {
                        "name": "monitor",
                        "content": "Monitors one or all objects owned by the owner of busname.\n"
                    },
                    {
                        "name": "call",
                        "content": "Invokes a method on a remote object. Each argument to pass to the method must be\nspecified as a serialized GVariant except that strings do not need explicit quotes. The\nreturn values are printed out as serialized GVariant values.\n"
                    },
                    {
                        "name": "emit",
                        "content": "Emits a signal. Each argument to include in the signal must be specified as a serialized\nGVariant except that strings do not need explicit quotes.\n"
                    },
                    {
                        "name": "wait",
                        "content": "Waits until busname is owned by some process on the bus. If the --activate is specified,\nthat bus name will be auto-started first. It may be the same as the bus name being waited\nfor, or different.\n"
                    },
                    {
                        "name": "help",
                        "content": "Prints help and exit.\n"
                    }
                ]
            },
            "BASH COMPLETION": {
                "content": "gdbus ships with a bash completion script to complete commands, destinations, bus names,\nobject paths and interface/method names.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "This shows how to introspect an object - note that the value of each\nproperty is displayed:\n\n$ gdbus introspect --system \\\n--dest org.freedesktop.NetworkManager \\\n--object-path /org/freedesktop/NetworkManager/Devices/0\nnode /org/freedesktop/NetworkManager/Devices/0 {\ninterface org.freedesktop.DBus.Introspectable {\nmethods:\nIntrospect(out s data);\n};\ninterface org.freedesktop.DBus.Properties {\nmethods:\nGet(in  s interface,\nin  s propname,\nout v value);\nSet(in  s interface,\nin  s propname,\nin  v value);\nGetAll(in  s interface,\nout a{sv} props);\n};\ninterface org.freedesktop.NetworkManager.Device.Wired {\nsignals:\nPropertiesChanged(a{sv} arg0);\nproperties:\nreadonly b Carrier = false;\nreadonly u Speed = 0;\nreadonly s HwAddress = '00:1D:72:88:BE:97';\n};\ninterface org.freedesktop.NetworkManager.Device {\nmethods:\nDisconnect();\nsignals:\nStateChanged(u arg0,\nu arg1,\nu arg2);\nproperties:\nreadonly u DeviceType = 1;\nreadonly b Managed = true;\nreadwrite o Ip6Config = '/';\nreadwrite o Dhcp4Config = '/';\nreadwrite o Ip4Config = '/';\nreadonly u State = 2;\nreadwrite u Ip4Address = 0;\nreadonly u Capabilities = 3;\nreadonly s Driver = 'e1000e';\nreadwrite s Interface = 'eth0';\nreadonly s Udi = '/sys/devices/pci0000:00/0000:00:19.0/net/eth0';\n};\n};\n\nThe --recurse and --only-properties options can be useful when wanting to inspect all objects\nowned by a particular process:\n\n$ gdbus introspect --system --dest org.freedesktop.UPower --object-path / --recurse  --only-properties\nnode / {\nnode /org {\nnode /org/freedesktop {\nnode /org/freedesktop/UPower {\ninterface org.freedesktop.UPower {\nproperties:\nreadonly b IsDocked = true;\nreadonly b LidForceSleep = false;\nreadonly b LidIsPresent = false;\nreadonly b LidIsClosed = false;\nreadonly b OnLowBattery = false;\nreadonly b OnBattery = false;\nreadonly b CanHibernate = true;\nreadonly b CanSuspend = true;\nreadonly s DaemonVersion = '0.9.10';\n};\nnode /org/freedesktop/UPower/Policy {\n};\nnode /org/freedesktop/UPower/Wakeups {\ninterface org.freedesktop.UPower.Wakeups {\nproperties:\nreadonly b HasCapability = true;\n};\n};\n};\n};\n};\n};\n\nIn a similar fashion, the introspect command can be used to learn details about the Notify\nmethod:\n\n[...]\ninterface org.freedesktop.Notifications {\nmethods:\nGetServerInformation(out s returnname,\nout s returnvendor,\nout s returnversion,\nout s returnspecversion);\nGetCapabilities(out as returncaps);\nCloseNotification(in  u id);\nNotify(in  s appname,\nin  u id,\nin  s icon,\nin  s summary,\nin  s body,\nin  as actions,\nin  a{sv} hints,\nin  i timeout,\nout u returnid);\n};\n[...]\n\nWith this information, it's easy to use the call command to display a notification\n\n$ gdbus call --session \\\n--dest org.freedesktop.Notifications \\\n--object-path /org/freedesktop/Notifications \\\n--method org.freedesktop.Notifications.Notify \\\nmyappname \\\n42 \\\ngtk-dialog-info \\\n\"The Summary\" \\\n\"Here's the body of the notification\" \\\n[] \\\n{} \\\n5000\n(uint32 12,)\n\nCall a method with file handle argument:\n\n$ gdbus call --session \\\n--dest org.example.foo \\\n--object-path /org/example/foo \\\n--method SendFDs \\\n1 \\\n10 \\\n10<file.foo\n\nMonitoring all objects on a service:\n\n$ gdbus monitor --system --dest org.freedesktop.ConsoleKit\nMonitoring signals from all objects owned by org.freedesktop.ConsoleKit\nThe name org.freedesktop.ConsoleKit is owned by :1.15\n/org/freedesktop/ConsoleKit/Session2: org.freedesktop.ConsoleKit.Session.ActiveChanged (false,)\n/org/freedesktop/ConsoleKit/Seat1: org.freedesktop.ConsoleKit.Seat.ActiveSessionChanged ('',)\n/org/freedesktop/ConsoleKit/Session2: org.freedesktop.ConsoleKit.Session.ActiveChanged (true,)\n/org/freedesktop/ConsoleKit/Seat1: org.freedesktop.ConsoleKit.Seat.ActiveSessionChanged ('/org/freedesktop/ConsoleKit/Session2',)\n\nMonitoring a single object on a service:\n\n$ gdbus monitor --system --dest org.freedesktop.NetworkManager --object-path /org/freedesktop/NetworkManager/AccessPoint/4141\nMonitoring signals on object /org/freedesktop/NetworkManager/AccessPoint/4141 owned by org.freedesktop.NetworkManager\nThe name org.freedesktop.NetworkManager is owned by :1.5\n/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x5c>},)\n/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x64>},)\n/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x5e>},)\n/org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({'Strength': <byte 0x64>},)\n\nEmitting a signal:\n\n$ gdbus emit --session --object-path /foo --signal org.bar.Foo \"['foo', 'bar', 'baz']\"\n\nEmitting a signal to a specific process:\n\n$ gdbus emit --session --object-path /bar --signal org.bar.Bar someString --dest :1.42\n\nWaiting for a well-known name to be owned on the bus; this will not auto-start the service:\n\n$ gdbus wait --session org.bar.SomeName\n\nAuto-starting then waiting for a well-known name to be owned on the bus:\n\n$ gdbus wait --session --activate org.bar.SomeName\n\nAuto-starting a different service, then waiting for a well-known name to be owned on the bus.\nThis is useful in situations where SomeName is not directly activatable:\n\n$ gdbus wait --session --activate org.bar.PrerequisiteName org.bar.SomeName\n\nWaiting for a well-known name and giving up after 30 seconds. By default, the timeout is\ndisabled; or set --timeout to 0 to disable it:\n\n$ gdbus wait --session --timeout 30 org.bar.SomeName\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Please send bug reports to either the distribution bug tracker or the upstream bug tracker at\nhttps://gitlab.gnome.org/GNOME/glib/issues/new.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "dbus-send(1)\n\n\n\nGIO                                                                                         GDBUS(1)",
                "subsections": []
            }
        }
    }
}