diff options
Diffstat (limited to 'lib/hooks/flag-changed.go')
-rw-r--r-- | lib/hooks/flag-changed.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/hooks/flag-changed.go b/lib/hooks/flag-changed.go new file mode 100644 index 00000000..aaeff014 --- /dev/null +++ b/lib/hooks/flag-changed.go @@ -0,0 +1,27 @@ +package hooks + +import ( + "fmt" + + "git.sr.ht/~rjarry/aerc/config" +) + +type FlagChanged struct { + Account string + Folder string + FlagName string +} + +func (m *FlagChanged) Cmd() string { + return config.Hooks.FlagChanged +} + +func (m *FlagChanged) Env() []string { + env := []string{ + fmt.Sprintf("AERC_ACCOUNT=%s", m.Account), + fmt.Sprintf("AERC_FOLDER=%s", m.Folder), + fmt.Sprintf("AERC_FLAG=%s", m.FlagName), + } + + return env +} |