-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
38 lines (34 loc) · 797 Bytes
/
main.go
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
package main
import (
"fmt"
"os"
"time"
//"github.com/mattn/go-gtk/glib"
"github.com/mattn/go-gtk/gtk"
"janp/janplib"
)
//Make sure to create ~/.janp.json before running.
func main() {
gtk.Init(nil)
onload := func(w *gtk.Window) {
fmt.Println("Goroutine is exiting")
}
var alert = "Test alert"
if (len(os.Args) > 1) {
if (os.Args[1] == "-v" || os.Args[1] == "--version") {
fmt.Println("janp version 1.2")
return;
}
alert = os.Args[1]
}
cfg, err2 := janplib.LoadConfig()
if (err2 != nil) {
fmt.Println("Error loading cfg")
fmt.Println(err2)
}
monitor := int(cfg.XineramaHead);
notificationTime := int(cfg.NotificationTime);
janplib.Notifyf(uint32(monitor), time.Second*time.Duration(notificationTime), onload, alert)
fmt.Println("Test")
//go gtk.Main()
}