Skip to content

feat(linux): add --no-tray-icon to hide the tray while keeping the GUI - #714

Open
RamfiAogusto wants to merge 1 commit into
librepods-org:linux/rustfrom
RamfiAogusto:feat/no-tray-icon
Open

feat(linux): add --no-tray-icon to hide the tray while keeping the GUI#714
RamfiAogusto wants to merge 1 commit into
librepods-org:linux/rustfrom
RamfiAogusto:feat/no-tray-icon

Conversation

@RamfiAogusto

Copy link
Copy Markdown

Problem

--no-tray does more than its name suggests. It takes the headless path in main.rs and never starts the iced application:

if args.no_tray {
    // Run headless without UI
    info!("Running in headless mode (no GUI)");

So anything that needs the window becomes unreachable. A BluetoothUIMessage::OpenWindow is still accepted and sent, but there is no consumer on the other end, and the window silently never opens.

That behaviour is correct for a headless run. The gap is that it is the only way to remove the tray icon, so hiding the icon also costs the GUI.

This matters on desktops where a panel indicator already shows battery and listening mode. The tray icon is then redundant, but removing it today means losing the window with it.

Change

--no-tray-icon skips only the tray registration and leaves the GUI running, so the window can still be opened.

--no-tray is untouched and keeps its current headless behaviour.

Testing

Built and run on Ubuntu 26.04, GNOME Shell 50.1 (Wayland), with AirPods Pro 3.

With --no-tray-icon --start-minimized:

  • no Running in headless mode line in the log — the GUI is up
  • no org.kde.StatusNotifierItem-* name on the session bus — the icon is gone
  • an OpenWindow message is both received and consumed, and the window opens

--no-tray was re-checked and still runs headless as before.

--no-tray does more than its name suggests: it runs headless and never
starts the iced application at all. Anything that needs the window is then
unreachable, since a BluetoothUIMessage::OpenWindow has no consumer and the
window silently never opens.

That is the right behaviour for a headless run, but it leaves no way to
hide only the tray icon. On desktops where a panel indicator already shows
the device state, the tray icon is redundant, and today the only way to
remove it also removes the window.

--no-tray-icon skips the tray registration and leaves the GUI running, so
the window can still be opened. --no-tray keeps its current behaviour.
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