A vendor or relay can hand out a ready-made provider as a link. The app registers the magpie scheme (Info.plist on macOS, HKCU on Windows, a .desktop handler on Linux), a second launch hands the link to the running one, and the window shows what the link would add, with the hosts the prompts and key would go to, before anything is saved. `magpie import` does the same in a terminal.
11 lines
271 B
Go
11 lines
271 B
Go
package gui
|
|
|
|
import "github.com/godbus/dbus/v5"
|
|
|
|
// sessionBus reports whether a D-Bus session bus is reachable; Wails'
|
|
// single-instance lock needs one and gives up on the whole app without it.
|
|
func sessionBus() bool {
|
|
_, err := dbus.SessionBus()
|
|
return err == nil
|
|
}
|