Registry / devops / ghostty-ambient

ghostty-ambient

JSON →
library0.9.0pypypiunverified

Ambient light-aware Ghostty theme selector using Bayesian preference learning. Dynamically adjusts terminal theme based on environmental brightness and warmth via on-device ALS sensor (macOS) or periodic sampling. Uses a Bayesian HMM to learn user preferences over time. v0.9.0 requires Python >=3.12 and relies on a compiled sensor binary (macOS). The CLI provides a picker, daemon mode, and manual set commands.

pip install ghostty-ambient
INSTALL
IMPORT
SIG · GHOSTTY-AMBIENT
G
ghostty-ambient
devopspythonv0.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AmbientPicker
from ghostty_ambient import AmbientPicker
from ghostty_ambient.picker import AmbientPicker

Basic usage: create an AmbientPicker, get lux, and get a theme recommendation.

from ghostty_ambient.picker import AmbientPicker import os # Instantiate picker with optional environment sensor override picker = AmbientPicker( ghostty_config_path=os.path.expanduser("~/.config/ghostty/config"), state_dir=os.path.expanduser("~/.local/share/ghostty-ambient"), ) # Get current ambient lux (with fallback) lux = picker.get_current_lux() print(f"Ambient lux: {lux}") # Recommend a theme recommendation = picker.recommend() print(f"Recommended theme: {recommendation}")
ghostty-ambient --version
Debug
Known issues
breakingPython 3.12 minimum: ghostty-ambient uses match/case and other 3.12+ features. Will fail on earlier Python versions.
fix
Upgrade Python to 3.12 or later.
affects: >=0.1.0
gotchamacOS ALS sensor binary required for light measurement: On macOS, the sensor binary (als) is compiled on first import. If the binary fails or is not found, the library will fall back to a legacy get_lux() method, which may be inaccurate or unavailable.
fix
Ensure the binary compiles (requires clang or the built binary). Run 'ghostty-ambient daemon' once to trigger compilation. Alternatively, set sensor backend explicitly.
affects: >=0.8.3
deprecatedLegacy get_lux() is deprecated in favor of the sensor backend. Future versions may remove it.
fix
Use AmbientPicker.get_current_lux() which internally uses the sensor backend with fallback.
affects: >=0.8.1
gotchaState directory must be writable: The library stores Bayesian model state and theme history in ~/.local/share/ghostty-ambient by default. If the directory is not writable, recommendations fail silently.
fix
Ensure the state directory exists and is writable, or set a custom state_dir.
affects: >=0.1.0
Upgrade
Version history
0.9.0latest on PyPI · released Jan 23, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
ghostty-ambient — pip install ghostty-ambient · libregistry