A generic, lightweight Linux daemon that exposes process context (e.g., gaming activity), hardware inventory, and system ambient lighting context via Varlink interfaces.
contextd allows userspace applications to:
- Detect active sessions: Seamlessly identify when a high-performance app or game starts or stops across multiple launchers.
- Hardware Inventory: List connected peripherals (keyboards, mice, controllers) and check their access permissions (
uaccess). - IPC Ambient Lighting Bridge: Exposes unprivileged sockets for user-level apps and hardware micro-daemons (like
argbdor OpenRGB bridges) to publish and consume ambient lighting vibe contexts.
contextd/
├── src/ # contextd Core System & RGB Daemon
├── contextd-client/ # Official Rust Client Library (contextd-client)
└── bridges/
└── openrgb-contextd-bridge/ # Optional OpenRGB SDK TCP Bridge (Port 6742)
contextd: Core daemon serving game detection, hardware inventory, and RGB observer/control Varlink sockets.contextd-client: Official Rust client crate providing type-safe Rust interfaces (ObserverClient,ControlClient) with automatic connection recovery.openrgb-contextd-bridge: Optional TCP server bridge on port 6742 that accepts OpenRGB SDK RGB updates and forwards them tocontextd.
- Wide Launcher Support: Detects games and apps from Steam (Native/Flatpak), Heroic Games Launcher, and Lutris.
- Hardware-Aware: Groups complex udev nodes into single logical devices; provides main hardware and dedicated RGB inventory.
- System Diagnostics: Reports RAM, CPU, GPU specs, kernel version, and verifies Vulkan and OpenGL libraries.
- Modern IPC: Uses Varlink over Unix sockets (
/run/contextd/public/contextd-rgb-observer.socketand/run/contextd/private/contextd-rgb-control.socket). - systemd Native: Distributed as a systemd portable service (
portablectl) for zero-dependency Linux deployment.
Run the production deployment script to assemble the portable OS tree in /opt/contextd and manage portablectl attachment:
./scripts/deploy.shTo start the optional OpenRGB SDK bridge daemon on TCP port 6742:
sudo systemctl enable --now openrgb-contextd-bridge.serviceUse the contextctl helper to query the daemon:
# Get active game/app
./scripts/contextctl.sh active
# List installed games
./scripts/contextctl.sh list-games
# List connected gaming peripherals
./scripts/contextctl.sh list-devices
# List RGB controllers, fans, and lights
./scripts/contextctl.sh list-rgb
# Get system diagnostics
./scripts/contextctl.sh diagnostics- Unprivileged Observer Socket: Ambient lighting vibe stream is public via
/run/contextd/public/contextd-rgb-observer.socket. - Restricted Control Socket: Writing lighting state changes is handled via
/run/contextd/private/contextd-rgb-control.socket. - Peer Validation: Uses
SO_PEERCREDto identify systemd units for restricted operations.
Build and run CI tests across the workspace:
cargo fmt -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --workspaceMIT
