mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
add support for config file, keybinding for exporting active config
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user