Adding Slack modules
This commit is contained in:
@@ -13,6 +13,11 @@ type PollConfig struct {
|
||||
Command string `yaml:"command"` // shell command whose output is checked
|
||||
Interval string `yaml:"interval"` // how often to poll, e.g. "2s" (default: "2s")
|
||||
Match string `yaml:"match"` // substring to find in output → "on" state; omit to use exit code 0
|
||||
|
||||
// Module-based alternative to Command: resolved to a shell string at startup.
|
||||
Module string `yaml:"module"`
|
||||
Function string `yaml:"function"`
|
||||
Params map[string]string `yaml:"params"`
|
||||
}
|
||||
|
||||
// KeyConfig defines what a single Stream Deck key does.
|
||||
@@ -24,6 +29,16 @@ type KeyConfig struct {
|
||||
IconTrue string `yaml:"icon_true"` // icon when poll match is true
|
||||
IconFalse string `yaml:"icon_false"` // icon when poll match is false
|
||||
Poll *PollConfig `yaml:"poll"`
|
||||
|
||||
// Module-based alternative to Command: resolved to a shell string at startup.
|
||||
Module string `yaml:"module"`
|
||||
Function string `yaml:"function"`
|
||||
Params map[string]string `yaml:"params"`
|
||||
}
|
||||
|
||||
// ModulesPath returns the path to the modules.yaml file next to the given config file.
|
||||
func ModulesPath(cfgPath string) string {
|
||||
return filepath.Join(filepath.Dir(cfgPath), "modules.yaml")
|
||||
}
|
||||
|
||||
// Config is the top-level structure of the YAML config file.
|
||||
|
||||
Reference in New Issue
Block a user