move config to $HOME
This commit is contained in:
parent
3d8197d7ae
commit
d87664a9f4
11
config.go
11
config.go
|
@ -15,7 +15,12 @@ type Config struct {
|
|||
}
|
||||
|
||||
func (config *Config) load() {
|
||||
configRaw, err := os.ReadFile("./config.jsonc")
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
log.Fatal("could not get home directory!", err)
|
||||
}
|
||||
|
||||
configRaw, err := os.ReadFile(homeDir + "/.config/gopaper/config.jsonc")
|
||||
if err != nil {
|
||||
log.Fatal("Couldn't open config file!\n", err)
|
||||
}
|
||||
|
@ -26,10 +31,6 @@ func (config *Config) load() {
|
|||
log.Fatal("Couldn't unmarshal config!\n", err)
|
||||
}
|
||||
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
log.Fatal("could not get home directory!", err)
|
||||
}
|
||||
config.Cache = homeDir + "/" + config.Cache + "/"
|
||||
//TODO: make directories if they don't
|
||||
config.ImagesDir = homeDir + "/" + config.ImagesDir + "/"
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
//All directories are relevant to the home folder, and will be created if they do not exist
|
||||
{
|
||||
"colorize":[ 247,40,60 ],
|
||||
"contrast":-35,
|
||||
"gamma":0.8,
|
||||
"imagesDir":"bgs",
|
||||
"duration":10,
|
||||
"cache":"slideshow" //this is where
|
||||
}
|
Loading…
Reference in New Issue