Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s00d/autorun
https://github.com/s00d/autorun
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/s00d/autorun
- Owner: s00d
- License: mit
- Created: 2023-08-02T11:47:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-02T12:51:37.000Z (over 1 year ago)
- Last Synced: 2023-09-05T03:28:01.717Z (over 1 year ago)
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# autorun go
[![GoDoc](https://godoc.org/github.com/s00d/autorun?status.svg)](https://godoc.org/github.com/s00d/autorun)
A Go library to run a command after login.
## Usage
```go
package mainimport (
"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