Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
dbus
✓ github.com/godbus/dbus/v5
Connects to session bus and retrieves the bus ID.
package main
import (
"fmt"
"os"
"github.com/godbus/dbus/v5"
)
func main() {
conn, err := dbus.ConnectSessionBus()
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
defer conn.Close()
var s string
err = conn.BusObject().Call("org.freedesktop.DBus.GetId", 0).Store(&s)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
fmt.Println(s)
}
Upgrade
Version history
4.1.0+incompatiblelatest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.