// The blueman module's Go tools bundle (novox/hq ADR 0188, ADR 0193, ADR 0208): the Bluetooth tray // applet in the operator's session, served by the node's runtime as the operator account. The module // holds no seat, so every tool is its own. The devices themselves are the bluetooth module's tools. package main import ( "fmt" "os" stdio "git.novox.be/novox/mesh-sdk/go" ) func main() { if err := stdio.Serve("", tools()); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } var machine = NewMachine() func tools() []stdio.Tool { return []stdio.Tool{ { Name: "blueman_status", Description: "The Bluetooth applet: whether it and its tray icon run (pid, since, and the unit or " + "session scope they run in), the installed version, what starts it at login, the plugins the " + "running applet has loaded and those it has not, the plugin switches in the operator's settings, " + "and whether the applet sees Bluetooth on. Never starts the applet. (r)", Run: func(map[string]any) (any, error) { return machine.Status() }, }, { Name: "blueman_restart", Description: "End the applet and its tray icon (asked first, then forced after 5 s) and start the " + "applet again in the operator's desktop session, under the account's service manager. Answers " + "the pids ended and the new one. Needs someone logged in to the desktop. (a)", Run: func(map[string]any) (any, error) { return machine.Restart() }, }, { Name: "blueman_check", Description: "Check what the module promises and relies on: the package is installed; the applet has " + "exactly one start (the package's XDG autostart entry, which the session's dex runs; no " + "window-manager exec); it runs once in a desktop session; and the Bluetooth daemon is running " + "(the bluetooth module's). Answers ok and each finding with what to do. (r)", Run: func(map[string]any) (any, error) { return machine.Check() }, }, } }