dotfiles/.config/gnome-settings/elgato/toggle_keylights.py
Alexander Hess f3f2417442
Update control scripts for Elgato keylights
- in my main office, I have two Elgato keylights placed on my desk
  and the Python scripts in this commit allow me to control the lights
  with Gnome keyboard shortcuts
- add an installation scripts that sets up a Python venv to run
  the above scripts
2023-05-04 02:17:32 +02:00

21 lines
428 B
Python
Executable file

#!/usr/bin/env python
import leglight
LEFT_KEYLIGHT_IP = "192.168.190.62"
RIGHT_KEYLIGHT_IP = "192.168.190.63"
left = leglight.LegLight(LEFT_KEYLIGHT_IP, port=9123)
right = leglight.LegLight(RIGHT_KEYLIGHT_IP, port=9123)
if left.info()["on"] or right.info()["on"]:
left.off()
right.off()
else:
left.on()
right.on()
left.brightness(30)
right.brightness(30)
left.color(6000)
right.color(6000)