Last active
July 11, 2020 15:04
-
-
Save Peetz0r/547b7464fbcf02052b6840bcbc6b8b94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import openrgb, glob | |
C = openrgb.utils.RGBColor | |
o = openrgb.OpenRGBClient() | |
d = o.devices[0] | |
z = d.zones[0] | |
d.set_mode(0) | |
while True: | |
t = max([int(open(i).read()) for i in glob.glob('/sys/class/hwmon/hwmon?/temp?_input')])/1000 | |
i = int(max(0,min(255, (t-30) / 60 * 256))) | |
c = C(i, 255-i, 0) | |
# print('t = %5.2f°C; i = %d; c = %s' % (t, i, c)) | |
z.set_color(c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Hot (temps => RGB) | |
Wants=openrgb.service | |
After=openrgb.service | |
[Service] | |
ExecStart=/home/peter/bin/hot.py | |
Restart=on-failure | |
User=peter | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=OpenRGB server | |
[Service] | |
ExecStart=/home/peter/OpenRGB/OpenRGB --server | |
ExecStartPost=sh -c 'until lsof -i :6742; do sleep .1; done;' | |
Restart=on-failure | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment