Files
voculinux/src/vocalinux/utils/snap.py
T
soubarnak ea7be5f111 feat(identity): rename user-visible identity to voculinux with one-time legacy import
The fork takes its own name everywhere a user can see it: binaries
(voculinux, voculinux-gui), desktop entry, autostart, tray, D-Bus
namespace (com.voculinux.Voculinux, no alias for the old name),
config/data/cache dirs, single-instance lock, IBus engine identity,
tray icons, resource prefixes, VOCULINUX_* environment names, and the
update-checker user agent. The internal Python module stays vocalinux
and the distribution metadata keeps the upstream URLs as provenance.

On first run a previous Vocalinux install's config.json, custom
dictionary, and portal restore token are copied once into the new
locations (new config always wins, no merge, no write-back); models
re-resolve through the pinned-checksum download path. An offline
naming-sweep test proves no old-name strings remain on user-visible
surfaces outside the allowlist.

Refs #18
2026-11-06 01:29:39 +05:30

23 lines
905 B
Python

"""Facts about the Snap build that the rest of the app has to account for.
The snap runs under strict confinement and builds whisper.cpp from source for
the plain x86-64 baseline with no GPU backend (see ``snap/snapcraft.yaml``).
Host GPU tools such as ``nvidia-smi`` and ``vulkaninfo`` are not visible inside
it either, so probing for them only produces misleading "not found" errors.
"""
import os
from typing import Mapping, Optional
#: Shown wherever the snap would otherwise offer or probe for a GPU backend.
SNAP_GPU_NOTE = (
"The Snap build runs whisper.cpp on the CPU. For GPU acceleration, "
"install the AppImage or use install.sh."
)
def running_in_snap(environ: Optional[Mapping[str, str]] = None) -> bool:
"""Whether this process runs inside the Voculinux snap."""
env = os.environ if environ is None else environ
return bool(env.get("SNAP_NAME") or env.get("SNAP"))