M4 networkmanager: open the page and tell the person
At a join, at the watcher's start and at a session's start while PORTAL, once per ask, the watcher opens the check address with systemd-run --user and xdg-open in the person's session and then shows the notification its outcome calls for, critical when the open failed; it says when the network is open, and handles what it hears during an open after it. Builds: design 08 sign-in-page §15, §18, §19, §22
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
// Telling the person (design 08 sign-in-page §19): org.freedesktop.Notifications.Notify on the session's bus, the
|
||||
// desktop notification service, app_name mesh.
|
||||
|
||||
import "github.com/godbus/dbus/v5"
|
||||
|
||||
func notifyOn(bus string, n note) error {
|
||||
conn, err := dbus.Connect(bus)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
hints := map[string]dbus.Variant{}
|
||||
if n.Critical {
|
||||
hints["urgency"] = dbus.MakeVariant(byte(2))
|
||||
}
|
||||
return conn.Object("org.freedesktop.Notifications", "/org/freedesktop/Notifications").
|
||||
Call("org.freedesktop.Notifications.Notify", 0, "mesh", uint32(0), "", n.Summary, n.Body, []string{}, hints,
|
||||
int32(-1)).Err
|
||||
}
|
||||
Reference in New Issue
Block a user