Discover Packages
github.com/Teages/go-autostart
package
module
Version:
v0.0.0-...-6e07ff2
Opens a new window with list of versions in this module.
Published: Sep 2, 2022
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
go-autostart
fork from emersion/go-autostart , for removing cgo
A Go library to run a command after login.
Usage
package main
import (
"log"
"github.com/emersion/go-autostart"
)
func main() {
app := &autostart.App{
Name: "test",
DisplayName: "Just a Test App",
Exec: []string{"sh", "-c", "echo autostart >> ~/autostart.txt"},
}
if app.IsEnabled() {
log.Println("App is already enabled, removing it...")
if err := app.Disable(); err != nil {
log.Fatal(err)
}
} else {
log.Println("Enabling app...")
if err := app.Enable(); err != nil {
log.Fatal(err)
}
}
log.Println("Done!")
}
Behavior
License
MIT
Expand ▾
Collapse ▴
Documentation
¶
Rendered for
linux/amd64
windows/amd64
darwin/amd64
js/wasm
An application that will be started when the user logs in.
Disable this app on startup.
Enable this app on startup.
Check if the app is enabled on startup.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.