Skip to content

Add tray icon with menu of all notes - #171

Open
bittner wants to merge 2 commits into
vixalien:mainfrom
bittner:feature/tray-icon
Open

Add tray icon with menu of all notes#171
bittner wants to merge 2 commits into
vixalien:mainfrom
bittner:feature/tray-icon

Conversation

@bittner

@bittner bittner commented Jul 2, 2026

Copy link
Copy Markdown

Adds a tray icon giving quick access to all notes: each menu entry shows a note's title with a color swatch matching its style, in the same order as the All Notes view, plus a Open Sticky Notes 🔍 entry that opens the app with the search entry focused.

While a tray host is present, the app keeps running when all windows are closed so the notes stay reachable from the tray; without one, nothing changes.

Activate via extension

GTK4 has no native tray support, so the icon and menu are provided over D-Bus (StatusNotifierItem and com.canonical.dbusmenu). On GNOME Shell the icon requires the AppIndicator and KStatusNotifierItem Support extension; this is documented in the README and the Flathub description.

Development shell (NixOS)

A separate commit contains a Nix flake for developing and running the app from the working tree.

Screenshot

sticky-notes-tray-icon

bittner and others added 2 commits July 2, 2026 17:56
Adds an implementation of the StatusNotifierItem and com.canonical.dbusmenu
D-Bus specifications, since GTK4 has no native tray icon support. The tray
menu offers the list of notes (newest first, sharing the application
window's sort order, each with a color swatch matching the note's style)
and an item that opens the application window with the search entry
focused. While a tray host is present, the application holds itself so that
closing all windows keeps it running and reachable from the tray; without a
tray host, behavior is unchanged. Also grants the Flatpak sandbox
permission to talk to the StatusNotifierWatcher, and documents in the
README and the Flathub app description that GNOME Shell needs the
AppIndicator extension to show the tray icon.

Menu items keep stable ids across rebuilds because hosts cache items by id;
in-place changes are announced with ItemsPropertiesUpdated, and AboutToShow
asks for a refresh since hosts defer layout updates while the menu is
closed. Notes whose relative order changed get fresh ids, so that hosts
process the reorder as remove and add: the AppIndicator GNOME Shell
extension silently drops moves of existing root-level items, because its
child-moved handler declares the signal arguments in the wrong order.
Adds a flake that exposes the application built from the working tree
(nix run), a dev shell with the meson, ninja, yarn and GJS toolchain
including a sticky-run helper that launches the app uninstalled through a
GResource overlay (nix develop), and an install-appindicator helper that
links the AppIndicator GNOME Shell extension into the user profile so the
tray icon can be tested with and without a StatusNotifierWatcher. Also
ignores the local meson and Nix build outputs.
@bittner bittner changed the title Add a tray icon with a menu of all notes Add tray icon with menu of all notes Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant