update doc

This commit is contained in:
Joesis
2020-05-11 02:03:14 -07:00
parent 986b75b8ac
commit 42b482ceb0
+27 -5
View File
@@ -10,7 +10,6 @@ systray is a cross-platform Go library to place an icon and menu in the notifica
```go
func main() {
// Should be called at the very beginning of main().
systray.Run(onReady, onExit)
}
@@ -35,7 +34,15 @@ Have go v1.12+ or higher installed? Here's an example to get started on macOS:
```sh
git clone https://github.com/getlantern/systray
env GO111MODULE=on go run systray/example/main.go
cd example
env GO111MODULE=on go build
./example
```
On Windows, you should build like this:
```
env GO111MODULE=on go build -ldflags "-H=windowsgui"
```
The following text will then appear on the console:
@@ -55,13 +62,15 @@ Now look for *Awesome App* in your menu bar!
### Linux
* Building apps requires the `gtk3` and `libappindicator3` development headers to be installed. For Debian or Ubuntu, you can may install these using:
* Building apps requires the `gtk3`, `libappindicator3` and `libwebkit2gtk-4.0-dev` development headers to be installed. For Debian or Ubuntu, you can may install these using:
```sh
sudo apt-get install libgtk-3-dev libappindicator3-dev
sudo apt-get install libgtk-3-dev libappindicator3-dev libwebkit2gtk-4.0-dev
```
* Checked menu items are not yet implemented
To build the example, run `go build example/main.go`. Before building, remove `example/rsrc.syso` which is only used on Windows.
* Submenu and checked menu items are not yet implemented
### Windows
@@ -86,9 +95,22 @@ SystrayApp.app/
SystrayApp.icns
```
When running as an app bundle, you may want to add one or both of the following to your Info.plist:
```xml
<!-- avoid having a blurry icon and text -->
<key>NSHighResolutionCapable</key>
<string>True</string>
<!-- avoid showing the app on the Dock -->
<key>LSUIElement</key>
<string>1</string>
```
Consult the [Official Apple Documentation here](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1).
## Credits
- https://github.com/xilp/systray
- https://github.com/cratonica/trayhost