• Stars
    star
    2,904
  • Rank 14,982 (Top 0.4 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a cross platfrom Go library to place an icon and menu in the notification area

systray

systray is a cross-platform Go library to place an icon and menu in the notification area.

Features

  • Supported on Windows, macOS, and Linux
  • Menu items can be checked and/or disabled
  • Most functions may be called from any goroutine

API

func main() {
	systray.Run(onReady, onExit)
}

func onReady() {
	systray.SetIcon(icon.Data)
	systray.SetTitle("Awesome App")
	systray.SetTooltip("Pretty awesome超级棒")
	mQuit := systray.AddMenuItem("Quit", "Quit the whole app")

	// Sets the icon of a menu item. Only available on Mac and Windows.
	mQuit.SetIcon(icon.Data)
}

func onExit() {
	// clean up here
}

See full API as well as CHANGELOG.

Note: this package requires cgo, so make sure you set CGO_ENABLED=1 before building.

Try the example app!

Have go v1.12+ or higher installed? Here's an example to get started on macOS:

git clone https://github.com/getlantern/systray
cd systray/example
env GO111MODULE=on go build
./example

On Windows, you should build like this:

env GO111MODULE=on go build -ldflags "-H=windowsgui"

Now look for Awesome App in your menu bar!

Awesome App screenshot

The Webview example

The code under webview_example is to demostrate how it can co-exist with other UI elements. Note that the example doesn't work on macOS versions older than 10.15 Catalina.

Platform notes

Linux

  • Building apps requires gcc as well as the gtk3 and libayatana-appindicator3 development headers to be installed. For Debian or Ubuntu, you may install these using:
sudo apt-get install gcc libgtk-3-dev libayatana-appindicator3-dev

On Linux Mint, libxapp-dev is also required.

If you need to support the older libappindicator3 library instead, you can pass the build flag legacy_appindicator when building. For example:

go build -tags=legacy_appindicator

To build webview_example, you also need to install libwebkit2gtk-4.0-dev and remove webview_example/rsrc.syso which is required on Windows.

Windows

  • To avoid opening a console at application startup, use these compile flags:
go build -ldflags -H=windowsgui

macOS

On macOS, you will need to create an application bundle to wrap the binary; simply folders with the following minimal structure and assets:

SystrayApp.app/
  Contents/
    Info.plist
    MacOS/
      go-executable
    Resources/
      SystrayApp.icns

When running as an app bundle, you may want to add one or both of the following to your Info.plist:

<!-- 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.

On macOS, it's possible to set the underlying NSStatusItemBehavior with systray.SetRemovalAllowed(true). When enabled, the user can cmd-drag the icon off the menu bar.

Credits

More Repositories

1

download

Lantern官方版本下载 蓝灯 翻墙 代理 科学上网 外网 加速器 梯子 路由 proxy vpn circumvention gfw
16,599
star
2

lantern

Lantern官方版本下载 蓝灯 翻墙 代理 科学上网 外网 加速器 梯子 路由 - Быстрый, надежный и безопасный доступ к открытому интернету - lantern proxy vpn censorship-circumvention censorship gfw accelerator پراکسی لنترن، ضدسانسور، امن، قابل اعتماد و پرسرعت
Go
13,542
star
3

lantern-binaries-archive

Lantern installers binary downloads.
Shell
2,799
star
4

firetweet

FireTweet for Android powered by Lantern
Java
273
star
5

http-proxy

HTTP Proxy with TLS support
Go
195
star
6

lantern-mobile

**Umaintained ** Lantern for Android
Java
114
star
7

www.getlantern.org

Superseded by https://github.com/getlantern/www
JavaScript
112
star
8

zenodb

Time-based database
Go
107
star
9

natty

Standalone WebRTC-based NAT traversal
C++
95
star
10

lantern-proxied-sites-lists

Wiki for maintaining different proxied sites lists for Lantern
63
star
11

lantern-binaries

This are the latest installers for the Lantern censorship circumvention tool
59
star
12

enproxy

Chained HTTP proxy that supports arbitrary TCP traffic tunneled over HTTP proxies using encapsulated HTTP requests
Go
47
star
13

wal

Write-ahead log in Golang
Go
41
star
14

www

The old website of lantern
JavaScript
39
star
15

sysproxy

Go library for managing system proxy
Go
36
star
16

go-natty

Go language wrapper around the natty NAT-traversal utility
Go
36
star
17

byteexec

Go library for executing files stored as byte arrays, handy for use with go-bindata.
Go
36
star
18

lampshade

Obfuscated encrypted network protocol for Lantern
Go
34
star
19

sockssh

SOCKS5 proxy to create SSH tunnels on demand
Go
31
star
20

gost

gost is like a vendoring `go get` that uses Git subtrees
Go
31
star
21

winfirewall

Control the Windows Firewall from Go, supports Windows XP API and Advanced Security COM API
C++
30
star
22

idletiming

Go
27
star
23

sysproxy-cmd

Command-line tool for setting HTTP(S) system proxy
C
27
star
24

pac-cmd

command line tool to change proxy auto-config settings of operation system
C
27
star
25

lantern-ui

UI for Lantern
JavaScript
26
star
26

multipath

Bond multiple connections for throughput and reliability.
Go
25
star
27

tunio

tunio forwards TCP packets to a net.Dialer
C
23
star
28

fronted

Go library for doing domain fronting
Go
23
star
29

lantern-chrome-extension

Google Chrome extension for Lantern
JavaScript
22
star
30

tarfs

In-memory tar-based filesystem for go
Go
21
star
31

awesome-go-lantern

Cool libraries, frameworks, tips and tricks and anything that can be useful to share
21
star
32

kaleidoscope

Java library for implementing the kaleidoscope limited advertisement protocol
Java
20
star
33

proxy

Golang library for core proxying logic
Go
20
star
34

winproxy

Executable for manipulating Windows system proxy settings. This uses wininet and allows the setting of PAC files instead of winhttp that tools like netsh uses and that are more limited. Works on Windows XP and above.
C++
20
star
35

deepcopy

Deep copying for Go
Go
19
star
36

geneva

Port of Geneva to Go
Go
18
star
37

pac

A simple Go library to toggle on and off system pac for various OS
Go
18
star
38

ats

Lantern chained server implemented using Apache Traffic Server
C
18
star
39

lanterntemp

蓝灯Windows下载 https://raw.githubusercontent.com/getlantern/lantern-binaries/master/lantern-installer.exe 蓝灯安卓下载 https://raw.githubusercontent.com/getlantern/lantern-binaries/master/lantern-installer.apk
17
star
40

autoupdate

Provides interfaces for helping lantern tools update themselves.
Go
16
star
41

keyman

Easy golang RSA key management
Go
16
star
42

gotun

Go library for working with tun interfaces
Go
16
star
43

tlsproxy

A TLS proxy kind of like stunnel
Go
15
star
44

autoupdate-server

Go
15
star
45

notifier

A library for sending native desktop notifications from Go
Go
14
star
46

lantern-mobile-single-app-example

Minimal Android app to ease Flashlight mobile backend development and testing
Java
14
star
47

flashlight-build

Repeatable builds for Lantern, using docker.
Go
14
star
48

sitescanner

Tunnel scanner
Go
14
star
49

waddell

Go
14
star
50

go-geoserve

Geoip lookup server/library written in Go and using MaxMind GeoLite2 City
Go
12
star
51

lantern-roadmap

Roadmap for Lantern development
12
star
52

libnatpmp

Libnatpmp with Java support
C
12
star
53

protected

protected is used for creating "protected" connections that bypass Android's VPNService
Go
11
star
54

httpseverywhere

Go implementation of using HTTPS Everywhere rule sets to send traffic over HTTPS
Go
11
star
55

go-udtwrapper

Go (golang) wrapper for the UDT networking library
C++
10
star
56

osversion

Get OS version information from Go
Go
10
star
57

redistrict

CLI utility written in Go for migrating redis data
Go
9
star
58

gonat

Go library for NAT'ing of TCP and UDP traffic
Go
9
star
59

webrtc-java

Java wrapper around WebRTC
Java
9
star
60

measured

Wraps a dialer to measure the delay, throughput and errors of a connection
Go
9
star
61

nattywad

NAT traversal with go-natty and waddell
Go
9
star
62

elevate

package elevate provides support for executing commands with elevated privileges.
C
9
star
63

geneva-cli

Command-line interface to Geneva
Go
8
star
64

lantern-docs

Design and implementation docs for the Lantern projects
HTML
8
star
65

firetweet.io

CSS
7
star
66

urlcache

Go library that caches the contents of a web URL
Go
7
star
67

proxysetup

proxysetup is a command-line utility that allows managing Macintosh proxy settings via the networksetup program without having to sudo or supply one's password
C
7
star
68

detour

Go
6
star
69

fdcount

Go utility for counting file descriptors
Go
6
star
70

WinProxy4J

Library using JNI and InternetSetOptions in WinInet.dll to set the system proxy on Windows.
C++
6
star
71

getlantern.github.io

CSS
6
star
72

pubsub

Infrastructure for pubsub messaging
Go
6
star
73

netx

Handy extensions to the standard net package
Go
6
star
74

laeproxy

Lantern App Engine Proxy - free proxy anyone can deploy to App Engine for use with Lantern desktop clients
Python
6
star
75

go-reverseproxy

HTTP reverse proxy handler that's almost exactly the same as httputil.ReverseProxy but adds a DynamicFlushInterval
Go
6
star
76

framed

Basic golang support for framing small messages over streams like TCP
Go
6
star
77

kcpwrapper

Wrapper around kcp-go that allows the use of regular net interfaces like dialing and listening
Go
6
star
78

lantern-java

IDL
5
star
79

cmux

Golang connection multiplexing based on smux
Go
5
star
80

hidden

Hide text in text
Go
5
star
81

direct-ip-scanner

Direct IP Scanner
Go
5
star
82

balancer

Connection balancer library for Go
Go
5
star
83

ops

Track success or failure of operations in code
Go
5
star
84

cljs-react-victory

Victory graphs for ClojureScript
Clojure
5
star
85

bbrconn

Wrapper for Go's net.Conn that exposes BBR congestion control info
Go
5
star
86

mitm

Go library for man-in-the-middling pairs of connections
Go
5
star
87

pbe

Experimental go library for encrypting and decrypting messages using a password-derived secret keys and authenticated encryption
Go
4
star
88

withtimeout

go library for adding a timeout to any operation
Go
4
star
89

preconn

Go library for inserting data at the head of a connection
Go
4
star
90

serveme

Go library for client-server TCP communication in which the server dials the client
Go
4
star
91

packetforward

Packet forwarding on top of gotun
Go
4
star
92

waitforserver

Provides a Go function to wait for a server at given address.
Go
4
star
93

go-udtrelay

Go convenience API for the UDT Gateway System (github.com/getlantern/go-udtrelay/udtrelay)
Go
4
star
94

i18n

simple i18n utility
Go
4
star
95

Exceptional4j

Uses Exceptional to report Java exceptions
Java
4
star
96

bytecounting

go library for counting bytes read/written on net.Conn and net.Listener.
Go
4
star
97

ema

Exponential Moving Averages for Go
Go
4
star
98

lantern-forum-ru

Lantern forum for Russian users
4
star
99

httptest

Golang http testing mock similar to net/http/httptest.ResponseRecorder but with support for the Hijacker interface
Go
4
star
100

quicwrapper

Wrapper around quic-go for lantern
Go
3
star