lib/hooks/aerc-shutdown.go
raw| 1 | package hooks |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | "time" |
| 6 | |
| 7 | "git.sr.ht/~rjarry/aerc/config" |
| 8 | ) |
| 9 | |
| 10 | type AercShutdown struct { |
| 11 | Lifetime time.Duration |
| 12 | } |
| 13 | |
| 14 | func (a *AercShutdown) Cmd() string { |
| 15 | return config.Hooks().AercShutdown |
| 16 | } |
| 17 | |
| 18 | func (a *AercShutdown) Env() []string { |
| 19 | return []string{ |
| 20 | fmt.Sprintf("AERC_LIFETIME=%s", a.Lifetime.String()), |
| 21 | } |
| 22 | } |