Skip to content

ddebruijne/Tray

Repository files navigation

Cross-platform Linux/Windows/MacOS Tray

Cross-platform, super tiny implementation of a system tray icon with a popup menu.

Works well on:

  • Linux/Gtk (libappindicator) - Gnome3 may need an extension
  • Windows XP or newer (shellapi.h)
  • MacOS (Cocoa/AppKit)

This fork is a different implementation based on Dmitry Mikushin's fork. using more modern c++ and standard library. He brought together the original work of Serge Zaitsev and the most interesting forks and PRs of respectable contributors:

Prerequisites

  • CMake
  • Ninja, in order to have the same build commands on all platforms
  • AppIndicator on Linux:

Debian-based:

sudo apt install libappindicator3-dev

Arch-based:

sudo pacman -S libappindicator-gtk3

Building

mkdir build
cd build
cmake -G Ninja ..
ninja

Personally, I open the folder in VSCode with CMake and CMake Tools extensions, that auto configures everything. Had some issues with the flatpak version, so I recommend installing from AUR or using Microsoft's .deb file on linux.

Demo

Execute the tray_example application:

./tray_example

Usage

Needs updating. For now check example.cpp

License

This software is distributed under MIT license, so feel free to integrate it in your commercial products.