-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.go
31 lines (28 loc) · 809 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
package main
import (
"flag"
"github.com/golang/glog"
"github.com/janpfeifer/goshot/screenshot"
"github.com/janpfeifer/goshot/systray"
"os"
)
var (
flagSysTray = flag.Bool("systray", false,
"Set this flag to take the app run in a system tray, and respond to a "+
"global shortcut to take screenshots.")
flagHotkey = flag.String("hotkey", "win+control+s",
"Hotkey to register to trigger a screenshot. It accepts any combination "+
"of 'shift', 'control', 'win', 'alt' and normal key, separated by '+'. Eg.: "+
"'win+control+s`. Only used in -systray mode.")
)
func main() {
systray.PreParseArgs = make([]string, len(os.Args))
copy(systray.PreParseArgs, os.Args)
flag.Parse()
if *flagSysTray {
glog.Infof("Running in system tray.")
systray.Run()
} else {
screenshot.Run()
}
}