Profpatsch/.claude/CLAUDE-PROJECT-alacritty-change-color-scheme.md
alacritty-change-color-scheme Project
Node.js/TypeScript desktop automation hub providing theme management and display control via D-Bus/Varlink protocols.
Core Services
- Alacritty theme switching based on system dark/light mode
- Display brightness control for internal/external monitors
- OpenTelemetry tracing infrastructure
Key Components
- Theme Management: Monitors
org.freedesktop.portal.Settings, writes to~/.config/alacritty/alacritty-colors-autogen.toml - Brightness Control:
blight(internal) +ddcutil(external) with logarithmic scaling - OpenTelemetry: D-Bus tracer factory with span batching
- Protocols: D-Bus services + Varlink socket at
/run/user/1000/de.Profpatsch.alacritty.ColorScheme
D-Bus Interfaces
de.profpatsch.alacritty.ColorScheme:SetColorScheme(),SetColorSchemeTheme()de.profpatsch.DisplayBrightness:SetBrightnessAllMonitors(),SetBrightnessAllMonitorsRelative()de.profpatsch.otel.TracerFactory:CreateTracer()de.profpatsch.otel.Tracer:StartSpan(),EndSpan(),BatchSpans()
Configuration
- Themes: First arg = theme directory, defaults:
alacritty_0_12(dark),dayfox(light) - Brightness: Internal 0-255 log curve, External 0-100% with
/dev/bus/ddccidetection - OpenTelemetry: OTLP HTTP + console export
Architecture Notes
- Event-driven multi-service daemon with graceful hardware fallback
- TypeScript with comprehensive D-Bus interface definitions
- Span batching and debounced updates for performance
Usage
# Start daemon
alacritty-change-color-scheme ~/.config/alacritty/themes
# Theme switching
dbus-send --session --dest=de.profpatsch.alacritty.ColorScheme /de/profpatsch/alacritty/ColorScheme de.profpatsch.alacritty.ColorScheme.SetColorScheme string:prefer-dark
# Brightness control
dbus-send --session --dest=de.profpatsch.DisplayBrightness /de/profpatsch/DisplayBrightness de.profpatsch.DisplayBrightness.SetBrightnessAllMonitors double:7