Added a config parser

Add a config.yml/config.toml file to $HOME/.config/goMP/ so that user
configurations are read.
This commit is contained in:
aditya-K2
2021-11-05 12:40:46 +05:30
parent 8e05e1a865
commit 5ad7b90844
6 changed files with 46 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"github.com/spf13/viper"
"gitlab.com/diamondburned/ueberzug-go"
)
@@ -43,7 +44,7 @@ func openImage(path string, c chan string) {
var im *ueberzug.Image
if path != "stop" {
img2, _ := getImg(getAlbumArt(path))
im, _ = ueberzug.NewImage(img2, int(float32(IMG_X)*fw)+ADDITIONAL_PADDING_X, int(float32(IMG_Y)*fh)+ADDITIONAL_PADDING_Y)
im, _ = ueberzug.NewImage(img2, int(float32(IMG_X)*fw)+viper.GetInt("ADDITIONAL_PADDING_X"), int(float32(IMG_Y)*fh)+viper.GetInt("ADDITIONAL_PADDING_Y"))
}
d := <-c
if im != nil {