Adding Slack modules

This commit is contained in:
lwoodard
2026-04-13 11:27:18 -06:00
parent 1d9f0b519b
commit 639a08a808
5 changed files with 522 additions and 9 deletions

View File

@@ -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.