1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2025-02-23 07:53:59 +01:00
aerc/lib/hooks/aerc-startup.go
Moritz Poldrack f10b184eb3 hooks: add aerc-startup hook
Add a hook to run when aerc starts up. The environment is supplemented
with aerc version and the path to its binary.

References: https://todo.sr.ht/~rjarry/aerc/136
References: https://todo.sr.ht/~rjarry/aerc/139
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-04-01 01:01:09 +02:00

23 lines
344 B
Go

package hooks
import (
"fmt"
"os"
"git.sr.ht/~rjarry/aerc/config"
)
type AercStartup struct {
Version string
}
func (m *AercStartup) Cmd() string {
return config.Hooks.AercStartup
}
func (m *AercStartup) Env() []string {
return []string{
fmt.Sprintf("AERC_VERSION=%s", m.Version),
fmt.Sprintf("AERC_BINARY=%s", os.Args[0]),
}
}