autostart

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package autostart starts a program at sign-in, or stops doing so. Linux writes an XDG autostart desktop entry under the config home, or asks the Background portal inside a Flatpak. Windows sets a HKCU Run value. Elsewhere Enable, Disable and Enabled return ErrUnsupported.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.New("autostart: unsupported")

ErrUnsupported is returned by Enable, Disable and Enabled on a platform that has no start-at-sign-in mechanism here.

Functions

func Disable

func Disable(ctx context.Context, app string) error

Disable removes the start-at-sign-in entry named app.

func Enable

func Enable(ctx context.Context, app string, argv []string) error

Enable arranges for argv to run at sign-in under the name app. Inside a Flatpak it asks the Background portal; otherwise it writes app.desktop in the XDG autostart folder. argv is the command the session runs, or the command the portal starts inside the sandbox. ctx bounds the portal's consent dialog.

func Enabled

func Enabled(app string) (bool, error)

Enabled reports whether a start-at-sign-in entry named app exists in the XDG autostart folder. Inside a Flatpak the portal's entry is outside the sandbox's view, so Enabled reports false there; keep the choice yourself.

Types

This section is empty.

Jump to

Keyboard shortcuts

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