https://github.com/s00d/autorun
https://github.com/s00d/autorun
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/s00d/autorun
- Owner: s00d
- License: mit
- Created: 2023-08-02T11:47:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-02T12:51:37.000Z (almost 3 years ago)
- Last Synced: 2025-03-03T02:33:59.096Z (over 1 year ago)
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# autorun go
[](https://godoc.org/github.com/s00d/autorun)
A Go library to run a command after login.
## Usage
```go
package main
import (
"log"
"github.com/s00d/autorun"
)
func main() {
autostart := autorun.NewAutoRun()
if autorun.IsEnabled() {
log.Println("App is already enabled, removing it...")
if err := autorun.Disable(); err != nil {
log.Fatal(err)
}
} else {
log.Println("Enabling app...")
if err := autorun.Enable(); err != nil {
log.Fatal(err)
}
}
log.Println("Done!")
}
```
## License
MIT