shortcut

package
v0.1.1239 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package shortcut puts magpie in the Start menu on Windows. There it is one exe with no installer, so nothing else would: the first start of the desktop app makes a Magpie shortcut in the user's Start menu opening the exe it runs as, and Windows search finds it by that. It is made once: magpie remembers it did, and a shortcut the user deleted stays deleted (#508); one still there is pointed at the exe again when that was moved. A portable magpie (a data folder beside it) makes none and registers nothing, leaving no trace on the machine. Elsewhere it does nothing — the Mac has the app in Applications, Linux its own ways.

Index

Constants

View Source
const Name = "Magpie"

Name is what the shortcut is called, and what Windows search finds.

View Source
const StateName = "start-menu-shortcut"

StateName is the file in magpie's folder recording that the shortcut was made, and for which exe.

Variables

This section is empty.

Functions

func Ensure

func Ensure()

Ensure makes the shortcut on the first start, keeps it pointed at this magpie after that while it is there, and never makes it again once the user deleted it. A portable magpie makes none. It fails quietly — magpie runs the same without one — and is skipped with MAGPIE_NO_SHORTCUT=1 (tests, sandboxes).

func Stale

func Stale(target, dir, exe string) bool

Stale reports whether a shortcut opening target in dir is not one for exe: there is none yet, or the exe was moved. Windows paths are the same in any case.

func Target

func Target(exe string) string

Target is what the shortcut opens for exe: exe itself, but for a magpie left running from where an update moved it aside, the exe in its place, which is what the next start runs. An update replaces the exe where it is, so the shortcut stays good through it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL