|
|
@ -21,6 +21,7 @@ var commandBlacklist = []string{
|
|
21
|
21
|
func main() {
|
|
22
|
22
|
last := os.Args[1]
|
|
23
|
23
|
cmdName := os.Args[2]
|
|
|
24
|
exitStatus := os.Args[3]
|
|
24
|
25
|
t, err := time.Parse(time.RFC3339Nano, last)
|
|
25
|
26
|
if err != nil {
|
|
26
|
27
|
return
|
|
|
@ -31,7 +32,11 @@ func main() {
|
|
31
|
32
|
// notify window manager (bell character, some window managers/terminals mark when it appears)
|
|
32
|
33
|
fmt.Printf("\a")
|
|
33
|
34
|
// send notification for long-running commands
|
|
34
|
|
cmd := exec.Command("notify-send", fmt.Sprintf("%q done", cmdName), fmt.Sprintf("took %s", dur))
|
|
|
35
|
statusInfo := "done"
|
|
|
36
|
if exitStatus != "0" {
|
|
|
37
|
statusInfo = fmt.Sprintf("failed (%s)", exitStatus)
|
|
|
38
|
}
|
|
|
39
|
cmd := exec.Command("notify-send", fmt.Sprintf("%q %s", cmdName, statusInfo), fmt.Sprintf("took %s", dur))
|
|
35
|
40
|
cmd.Start()
|
|
36
|
41
|
}
|
|
37
|
42
|
fmt.Printf("(%s) ", dur)
|