sensible
sensible copied to clipboard
Allow sensible to run as user
Currently the settingsfile is hardcoded to be in /etc.
https://github.com/TheTinkerDad/sensible/blob/efad618468fd1c40e760b7e7cbc08686a20deadd/settings/settings.go#L56
this forces this app to be run as root. With small changes, it can be run from the user context:
//settings/settings.go
var settingsFolder string = os.Getenv("HOME")+"/.config/sensible/"
var settingsFile string = settingsFolder + "settings.yaml"
var logFile string = settingsFolder + "logs.txt"
...
//utility/fileutil.go
// CreateFolder Create a folder and check if creation was successful
func CreateFolder(path string) {
err := os.MkdirAll(path, os.ModePerm)
...
This will need to be adjusted so that it autodetects the context, and changes back to the original path's when run as root.