Skip to content
/ tray Public
forked from zserge/tray

Cross-platform, tiny go-library providing a system tray icon with a popup menu based on zserge/tray.

License

Notifications You must be signed in to change notification settings

trevex/tray

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tray

tray is a minimalistic go-library based on zserge/tray providing an updatable system tray on all major platforms.

Getting started

On Mac and Windows no further dependencies are required. Although make sure gcc is available on Windows to be able to use cgo, e.g. install tdm-gcc. On Linux gtk3 and libappindicator are required with their headers. Make sure to install them beforehand.

See example for usage instructions.

Known issues

  • No sub menu icons are supported
  • Will use a temporary file for the tray icon on Linux and Windows
  • To avoid memory leaks and issues with the several system libraries a pre-allocated array is used for the menu entries. This introduces a limit of up to 128 menu entries
  • Both the use of static allocation and the requirement to run on the main thread limit each executable to a single system tray menu
  • To also provide a GUI consider forking a process, because GUI libraries will require to run in the main thread as well, e.g. andlabs/ui

Acknowledgements

This library would not be possible without zserge/tray.

If you are looking for a more mature system tray, getlantern/systray might be a better choice. However it can not properly add/remove menu entries, which is why this library was created.

About

Cross-platform, tiny go-library providing a system tray icon with a popup menu based on zserge/tray.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 82.2%
  • C 13.3%
  • Objective-C 4.5%