Skip to content

nesdeq/fastsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

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
}
Key Default Notes
update_interval_ms 100 Capture rate (ms)
smoothing_factor 0.3 EMA coefficient, lower = smoother transitions
screen_portion 0.33 Bottom % of screen to sample
saturation_boost 1.4 Color saturation multiplier
warmth 0.03 Shift 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

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages