Add support for Windows.

master
Ronald1985 2 years ago
parent 91d1146fb4
commit 5929676a17

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

@ -13,6 +13,7 @@ require (
fyne.io/fyne/v2 v2.4.0 // indirect
fyne.io/systray v1.10.1-0.20230722100817-88df1e0ffa9a // indirect
github.com/akavel/rsrc v0.10.2 // indirect
github.com/cratonica/2goarray v0.0.0-20190331194516-514510793eaa // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dchest/jsmin v0.0.0-20220218165748-59f39799265f // indirect
github.com/fredbi/uri v1.0.0 // indirect
@ -53,10 +54,12 @@ require (
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/image v0.11.0 // indirect
golang.org/x/mobile v0.0.0-20230531173138-3c911d8e3eda // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2 // indirect

@ -63,6 +63,8 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cratonica/2goarray v0.0.0-20190331194516-514510793eaa h1:Wg+722vs7a2zQH5lR9QWYsVbplKeffaQFIs5FTdfNNo=
github.com/cratonica/2goarray v0.0.0-20190331194516-514510793eaa/go.mod h1:6Arca19mRx58CA7OWEd7Wu1NpC1rd3uDnNs6s1pj/DI=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -371,6 +373,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@ -539,6 +543,8 @@ golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

@ -0,0 +1,73 @@
//go:build windows
// +build windows
// File generated by 2goarray v0.1.0 (http://github.com/cratonica/2goarray)
package disabledicon
var Data []byte = []byte{
0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x20, 0x20, 0x10, 0x00, 0x01, 0x00,
0x04, 0x00, 0xe8, 0x02, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x28, 0x00,
0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0xb5, 0x00, 0x00, 0xff, 0x9b,
0x63, 0x00, 0xe6, 0xbe, 0x51, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14,
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x43, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x33, 0x11, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11,
0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x10, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x44, 0x00, 0x00, 0x44,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40,
0x00, 0x22, 0x22, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x44, 0x02, 0x22, 0x22, 0x22, 0x22, 0x20, 0x44, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x22, 0x22, 0x00, 0x00, 0x02,
0x22, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x02, 0x22,
0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x44, 0x02, 0x22, 0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0x44, 0x40,
0x00, 0x00, 0x00, 0x04, 0x44, 0x44, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00,
0x02, 0x20, 0x44, 0x44, 0x40, 0x00, 0x00, 0x44, 0x44, 0x44, 0x02, 0x20,
0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0x44, 0x44, 0x44, 0x00, 0x00, 0x44,
0x44, 0x44, 0x02, 0x20, 0x00, 0x00, 0x00, 0x44, 0x02, 0x20, 0x44, 0x44,
0x44, 0x00, 0x00, 0x04, 0x44, 0x44, 0x02, 0x20, 0x00, 0x00, 0x04, 0x44,
0x42, 0x20, 0x44, 0x44, 0x40, 0x00, 0x00, 0x00, 0x04, 0x44, 0x02, 0x20,
0x00, 0x00, 0x44, 0x44, 0x42, 0x20, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00,
0x00, 0x44, 0x02, 0x22, 0x00, 0x00, 0x44, 0x44, 0x22, 0x20, 0x44, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x22, 0x22, 0x00, 0x44, 0x22,
0x22, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02,
0x22, 0x22, 0x22, 0x22, 0x20, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x40, 0x00, 0x22, 0x22, 0x00, 0x04, 0x40, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x04,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x44, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc7, 0xff, 0xff, 0xff, 0x83, 0xff, 0xff, 0xff, 0x01, 0xff,
0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0x83, 0xff,
0xff, 0xff, 0x83, 0xf8, 0x1f, 0xff, 0xc7, 0xe0, 0x07, 0xff, 0xc7, 0x80,
0x01, 0xff, 0xef, 0x00, 0x00, 0xff, 0xee, 0x00, 0x00, 0x7f, 0xf8, 0x00,
0x00, 0x1f, 0xf0, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x03, 0x80, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
0x00, 0x01, 0xc0, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x0f, 0xf8, 0x00,
0x00, 0x1f, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0xff, 0xff, 0x80,
0x01, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

@ -0,0 +1,73 @@
//go:build windows
// +build windows
// File generated by 2goarray v0.1.0 (http://github.com/cratonica/2goarray)
package enabledicon
var Data []byte = []byte{
0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x20, 0x20, 0x10, 0x00, 0x01, 0x00,
0x04, 0x00, 0xe8, 0x02, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x28, 0x00,
0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9b, 0x63, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00, 0x22,
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x20,
0x00, 0x11, 0x11, 0x00, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x22, 0x01, 0x11, 0x11, 0x11, 0x11, 0x10, 0x22, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0x11, 0x10, 0x00, 0x00, 0x01,
0x11, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x01, 0x10,
0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x22, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x22, 0x20,
0x00, 0x00, 0x00, 0x02, 0x22, 0x22, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00,
0x01, 0x10, 0x22, 0x22, 0x20, 0x00, 0x00, 0x22, 0x22, 0x22, 0x01, 0x10,
0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x22, 0x22, 0x22, 0x00, 0x00, 0x22,
0x22, 0x22, 0x01, 0x10, 0x00, 0x00, 0x00, 0x22, 0x01, 0x10, 0x22, 0x22,
0x22, 0x00, 0x00, 0x02, 0x22, 0x22, 0x01, 0x10, 0x00, 0x00, 0x02, 0x22,
0x21, 0x10, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x02, 0x22, 0x01, 0x10,
0x00, 0x00, 0x22, 0x22, 0x21, 0x10, 0x22, 0x20, 0x00, 0x00, 0x00, 0x00,
0x00, 0x22, 0x01, 0x11, 0x00, 0x00, 0x22, 0x22, 0x11, 0x10, 0x22, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x11, 0x00, 0x22, 0x11,
0x11, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01,
0x11, 0x11, 0x11, 0x11, 0x10, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x20, 0x00, 0x11, 0x11, 0x00, 0x02, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x02,
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0x80,
0x01, 0xff, 0xff, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xf8, 0x00,
0x00, 0x1f, 0xf0, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x03, 0x80, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
0x00, 0x01, 0xc0, 0x00, 0x00, 0x03, 0xf0, 0x00, 0x00, 0x0f, 0xf8, 0x00,
0x00, 0x1f, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0x00, 0x00, 0xff, 0xff, 0x80,
0x01, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
}

@ -28,8 +28,8 @@ func SendNotification(title string, message string) bool {
if out == nil && err == nil {
return true
}
} else if strings.Contains(err.Error(), "executable file not found in $PATH") {
err := beeep.Notify(title, message, "")
} else if strings.Contains(err.Error(), "executable file not found in ") {
err := beeep.Notify(title, message, "assets/Eye-Reminder-Icon.png")
if err != nil {
panic(err)
}
@ -42,6 +42,7 @@ func systrayOnReady() {
var enabled bool = true
systray.SetTitle("Eye Reminder")
systray.SetTooltip("Eye Reminder")
systray.SetIcon(enabledicon.Data)
mQuitOrig := systray.AddMenuItem("Quit", "Quit the whole app")
go func() {
@ -51,31 +52,14 @@ func systrayOnReady() {
fmt.Println("Finished quitting")
}()
iconUpdated := false
go func() {
lastTimeNotificationWasSent := time.Now().Add(-20 * time.Minute)
for {
if enabled {
if !iconUpdated {
systray.SetIcon(enabledicon.Data)
iconUpdated = true
}
if time.Since(lastTimeNotificationWasSent) > TIME_INBETWEEN_NOTIFICATIONS {
go func() {
SendNotification("Eye Reminder", "Look away for the screen for atleast 20 seconds")
}()
lastTimeNotificationWasSent = time.Now()
}
} else {
if !iconUpdated {
systray.SetIcon(disabledicon.Data)
if enabled && time.Since(lastTimeNotificationWasSent) > TIME_INBETWEEN_NOTIFICATIONS {
SendNotification("Eye Reminder", "Look away for the screen for atleast 20 seconds")
iconUpdated = true
}
lastTimeNotificationWasSent = time.Now()
}
}
}()
@ -89,12 +73,16 @@ func systrayOnReady() {
case <-mEnabled.ClickedCh:
if mEnabled.Checked() {
mEnabled.Uncheck()
enabled = false
iconUpdated = false
systray.SetIcon(disabledicon.Data)
} else {
mEnabled.Check()
enabled = true
iconUpdated = false
systray.SetIcon(enabledicon.Data)
}
}
}

Loading…
Cancel
Save