Documentation
¶
Overview ¶
Package env hosts small platform-detection helpers shared by app, daemon, and any other layer that needs to know whether the current process can show a GUI. Living below internal/pkg keeps these helpers free of higher-level dependencies (app, systemtray, ...) so callers don't pull in the world just to ask "do I have a screen".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasGUI ¶
func HasGUI() bool
HasGUI returns true if the current process is running in an environment where a system tray (or any GUI) can reasonably be shown.
Detection layers (defensive — any one signal of "headless" wins):
- TERMUX_VERSION env — Termux sets this; never a GUI.
- GOOS == "android" — Go for Android Termux build.
- Linux without DISPLAY — no X server, no Wayland session.
- macOS over SSH — remote session, no Aqua UI.
- Anything unknown — default to headless to avoid hanging on a missing display.
Windows + macOS desktop sessions are assumed to have a GUI. Headless-build users still rely on the `headless` build tag to strip systemtray symbols; this helper is the runtime companion.
Types ¶
This section is empty.