Skip to content

Repository files navigation

FastSync

Sync Philips Hue lights with screen colors on Linux. Uses PipeWire/XDG portal for Wayland-native capture.

Dependencies

# Arch
pacman -S python-dbus python-gobject python-numpy gstreamer gst-plugins-base
# Debian/Ubuntu
apt install python3-dbus python3-gi python3-numpy gstreamer1.0-tools gstreamer1.0-plugins-base
# pip (if needed)
pip install dbus-python PyGObject numpy

Optional (for bridge discovery):

pip install zeroconf requests

Setup

python hue_setup.py
  1. Discovers bridges on network (cloud API + mDNS)
  2. Press bridge button when prompted
  3. Select which light to sync

Config saved to config.json.

Run

python hue_screen_sync.py

Select screen/monitor when portal dialog appears. Ctrl+C to stop.

Config

Edit config.json:

{
"bridge_ip": "192.168.1.x",
"api_key": "your-api-key",
"light_id": "1",
"update_interval_ms": 100,
"smoothing_factor": 0.3,
"screen_portion": 0.33,
"saturation_boost": 1.4,
"warmth": 0.03
}
KeyDefaultNotes
update_interval_ms100Capture rate (ms)
smoothing_factor0.3EMA coefficient, lower = smoother transitions
screen_portion0.33Bottom % of screen to sample
saturation_boost1.4Color saturation multiplier
warmth0.03Shift toward warm (red-ish) tones

How it works

Screen -> PipeWire -> GStreamer (64x36 RGB) -> bottom region avg
-> sRGB to CIE xy -> saturation/warmth adjust -> EMA smoothing
-> Hue bridge (HTTP PUT, coalesced @ 60Hz max)
  • XDG portal for screen access (works on Wayland)
  • Threaded HTTP sender to avoid blocking capture loop
  • D65 white point fallback for dark/black screens

License

GPLv2 - see LICENSE

About

Sync Philips Hue lights to your screen on Linux. Wayland-native via PipeWire and the XDG portal — no X11, no display-capture hacks.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages