env

package
v0.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 2 Imported by: 0

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):

  1. TERMUX_VERSION env — Termux sets this; never a GUI.
  2. GOOS == "android" — Go for Android Termux build.
  3. Linux without DISPLAY — no X server, no Wayland session.
  4. macOS over SSH — remote session, no Aqua UI.
  5. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL