Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultAFKThreshold = 300
DefaultAFKThreshold is the default idle-time threshold in seconds.
View Source
const DefaultVolume = 100
DefaultVolume is the default playback volume (0-100).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Steps []Step `json:"steps"`
}
Action holds an ordered list of steps to execute.
type Config ¶
type Config struct {
Options Options `json:"config"`
Profiles map[string]Profile `json:"profiles"`
}
Config holds the top-level configuration: global options and profiles.
func Load ¶
Load reads and parses a config file. It tries, in order:
- explicitPath (if non-empty)
- notify-config.json next to the running binary
- ~/.config/notify/notify-config.json
func (*Config) UnmarshalJSON ¶
UnmarshalJSON sets defaults then decodes the JSON structure. Go's json.Unmarshal merges into existing struct fields, so only values present in JSON override the defaults.
type Credentials ¶
type Credentials struct {
DiscordWebhook string `json:"discord_webhook,omitempty"`
}
Credentials holds secret values for remote notification actions.
type Options ¶
type Options struct {
AFKThresholdSeconds int `json:"afk_threshold_seconds,omitempty"`
DefaultVolume int `json:"default_volume,omitempty"`
Credentials Credentials `json:"credentials,omitempty"`
}
Options holds global settings parsed from the "config" key.
type Step ¶
type Step struct {
Type string `json:"type"` // "sound" | "say" | "toast" | "discord"
Sound string `json:"sound,omitempty"` // type=sound
Text string `json:"text,omitempty"` // type=say
Title string `json:"title,omitempty"` // type=toast
Message string `json:"message,omitempty"` // type=toast
Volume *int `json:"volume,omitempty"` // per-step override, nil = use default
When string `json:"when,omitempty"` // "afk" | "present" | "" (always)
}
Step is a single unit of work within an action.
Click to show internal directories.
Click to hide internal directories.