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-shutdown.go
Moritz Poldrack b46b2d2282 hooks: add aerc-shutdown
Add a hook to run when aerc shuts down. The environment is supplemented
with the duration aerc was alive for.

References: https://todo.sr.ht/~rjarry/aerc/136
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

22 lines
324 B
Go

package hooks
import (
"fmt"
"time"
"git.sr.ht/~rjarry/aerc/config"
)
type AercShutdown struct {
Lifetime time.Duration
}
func (a *AercShutdown) Cmd() string {
return config.Hooks.AercShutdown
}
func (a *AercShutdown) Env() []string {
return []string{
fmt.Sprintf("AERC_LIFETIME=%s", a.Lifetime.String()),
}
}