From d335e1f85a2be0ac8b53160c146cc6f849b10ba0 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sun, 20 Sep 2020 20:33:07 -0400 Subject: [PATCH] Fixup groupings in toml parsing ; update example config --- cmd/gui/README.md | 33 ++++++++++++++++++++++----------- config/config.go | 2 +- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/cmd/gui/README.md b/cmd/gui/README.md index 39c4f5a..83583a0 100644 --- a/cmd/gui/README.md +++ b/cmd/gui/README.md @@ -10,18 +10,29 @@ The GUI uses a config similar to the following. To generate a default config, la ``` -# Slideshow intervals -slideshow.slideinterval = "300s" -slideshow.restartinterval = "168h" +config-ui-only = false -# These are SYSTEMD.TIME formatted times -# You probably want to just adjust the actual times here -# See https://www.freedesktop.org/software/systemd/man/systemd.time.html -hdmi.off = "*-*-* 00:00:00" -hdmi.on = "*-*-* 06:00:00" +[albums] + root = "/tank/pictures" + selected = ["/", "/KemoNine"] + +[fan] + minspeed = 10.0 + pollinginterval = "30s" + + [fan.speeds] + 100 = 55.0 + 25 = 45.0 + 50 = 50.0 + 75 = 52.0 + +[hdmi] + off = "*-*-* 00:00:00" + on = "*-*-* 06:00:00" + +[slideshow] + restartinterval = "168h" + slideinterval = "300s" -# Album configuration (DO NOT CHANGE albums.root ) -albums.root = "/tank/pictures" -albums.selected = ["/", "/KemoNine"] ``` diff --git a/config/config.go b/config/config.go index 88ba200..ba465e7 100644 --- a/config/config.go +++ b/config/config.go @@ -24,7 +24,7 @@ func LoadConfig(errFatalOnMissing bool) (*koanf.Koanf, *kfile.File) { CONFIG_KEY_FAN_POLL_INTERVAL: DEFAULT_FAN_POLL_INTERVAL, CONFIG_KEY_FAN_SPEEDS: DEFAULT_FAN_SPEEDS, CONFIG_KEY_FAN_MIN_SPEED: DEFAULT_FAN_MIN_SPEED, - }, ""), nil) + }, "."), nil) // Bring in /etc/defaults/pf.toml if it exists configFileProvider := kfile.Provider(CONFIG_FILE_PATH)