diff --git a/config.go b/config.go index 9dd17b7..8ab9c2d 100644 --- a/config.go +++ b/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 + "/" diff --git a/config.jsonc b/config.jsonc deleted file mode 100644 index ad09456..0000000 --- a/config.jsonc +++ /dev/null @@ -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 -} diff --git a/go-img b/go-img new file mode 100755 index 0000000..1968df1 Binary files /dev/null and b/go-img differ diff --git a/go.mod b/go.mod index 2babdcc..8ae0bde 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module go-img +module gopaper go 1.23.2