blob: 49599a7a17c6a0f11c60060caa0e31541f9acd7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package statusline
import (
"git.lukeshu.com/go/libsystemd/sd_daemon"
)
type daemonStatus struct {
pid int
}
func DaemonStatus(pid int) StatusLine {
return &daemonStatus{pid: pid}
}
func (sl *daemonStatus) Put(line string) {
sd_daemon.Notification{
PID: sl.pid,
State: "STATUS=" + line,
}.Send(false)
}
func (sl *daemonStatus) End(keep bool) {
if keep {
return
}
sd_daemon.Notification{
PID: sl.pid,
State: "STATUS=",
}.Send(false)
}
|