add support for config file, keybinding for exporting active config

This commit is contained in:
Bradley Cicenas
2018-01-11 16:15:18 +00:00
parent d785b263f4
commit d743472b16
6 changed files with 133 additions and 1 deletions

View File

@@ -45,6 +45,14 @@ func GetSwitchVal(k string) bool {
return GetSwitch(k).Val
}
func UpdateSwitch(k string, val bool) {
sw := GetSwitch(k)
if sw.Val != val {
log.Noticef("config change: %s: %t -> %t", k, sw.Val, val)
sw.Val = val
}
}
// Toggle a boolean switch
func Toggle(k string) {
sw := GetSwitch(k)