Documentation
¶
Overview ¶
Package autostart opens magpie when the user logs in, in the tray with no window, so the gateway every agent is pointed at is there from the start. Whether it does is the system's own record — a launch agent on the Mac, a Run value on Windows, an autostart entry on Linux — not a setting of magpie's, so it can't say one thing while the system does another.
Index ¶
Constants ¶
const Arg = "tray"
Arg is what magpie is started with at login: the tray, no window.
const LoginItemsURL = "x-apple.systempreferences:com.apple.LoginItems-Settings.extension"
LoginItemsURL opens System Settings' Login Items pane, where a record that NeedsAllowing is allowed again.
Variables ¶
var ErrNoApp = errors.New("this magpie has no GUI, so it can't open in the tray at login, and no magpie app was found to open instead: install the magpie app, then turn on Open at login in its Settings")
ErrNoApp: `magpie autostart on` from a copy with no GUI, with no magpie app found to open at login in its place.
Functions ¶
func Refresh ¶ added in v0.1.586
func Refresh() error
Refresh brings the system's record up to date when magpie opens at login, for a record an older version wrote; it never turns it on.
func Repoint ¶ added in v0.1.2133
Repoint has the record that opens magpie at login open to instead, when it opens from: the Windows app installed itself from where it was downloaded (update.Settle). Nothing else in it changes, so a record the user switched off in Task Manager stays off, and none is made when there was none.
func Set ¶
Set has magpie open at login, or not, as this copy of it; on Linux, where a package's own autostart entry starts magpie, as that package's. A copy with no GUI (magpie-cli) names the app it goes with, since the record opens the tray, which it has none of; with no app to name, it says so and writes nothing.
Types ¶
type State ¶ added in v0.1.1295
type State string
State is whether magpie opens at login, as the system will act on it.
const ( // Off: no record, so nothing opens magpie at login. Off State = "off" // On: the record is there, and nothing the system says holds it back. On State = "on" // NeedsAllowing: the record is there, but the user switched it off in // the system's own settings (on the Mac, System Settings › General › // Login Items › Allow in the Background), so it opens nothing until // it is allowed there again; writing the record anew doesn't do that. NeedsAllowing State = "allow" )