-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
40 lines (32 loc) · 782 Bytes
/
main.go
File metadata and controls
40 lines (32 loc) · 782 Bytes
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
31
32
33
34
35
36
37
38
39
40
package main // package main
import (
"os"
"runtime"
"github.com/martinlindhe/notify"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Action = func(c *cli.Context) error {
appname := "hi"
if runtime.GOOS == "windows" {
// https://github.com/go-toast/toast/issues/9
appname = "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\WindowsPowerShell\\v1.0\\powershell.exe"
}
title := "hi"
contents := "there"
if len(c.Args()) >= 2 {
title = c.Args().Get(0)
contents = c.Args().Get(1)
} else if len(c.Args()) >= 1 {
title = "hi there"
contents = c.Args().Get(0)
}
notify.Notify(appname, title, contents, "dorobou_jikan.png")
return nil
}
app.Name = "hi"
app.Version = "0.1.0"
app.Usage = "desktop notifier"
app.Run(os.Args)
}