示例#1
0
#!/usr/bin/env python3

from openrgb import OpenRGBClient
from openrgb.utils import RGBColor, DeviceType

import psutil

client = OpenRGBClient()

cooler = client.get_devices_by_type(DeviceType.COOLER)[0]
cpu_led = cooler.zones[2].leds[0]

while True:
    current_temp = int(psutil.sensors_temperatures()['k10temp'][-1].current)

    min_temp = 35
    max_temp = 65

    min_hue = 0         #Red
    max_hue = 120       #Green
    
    step = max_hue / (max_temp - min_temp)
    
    offset = current_temp - min_temp
    current_hue = max_hue - (offset * step)

    if current_hue < min_hue:
        current_hue = min_hue

    cpu_led.set_color(RGBColor.fromHSV(current_hue, 100, 100))
示例#2
0
#!/usr/bin/env python3
from openrgb import OpenRGBClient
from openrgb.utils import RGBColor
import time

client = OpenRGBClient()

print(client)

print(client.devices)

client.off()

while True:
    for x in range(360):
        client.set_color(RGBColor.fromHSV(x, 100, 100))
        time.sleep(.05)
示例#3
0
#!/usr/bin/env python3
from openrgb import OpenRGBClient
from openrgb.utils import RGBColor
import time

client = OpenRGBClient()

print(client)

print(client.devices)

client.off()

while True:
    for x in range(360):
        client.set_color(RGBColor.fromHSV(x, 100, 100), fast=True)
        time.sleep(.05)
示例#4
0
#!/usr/bin/env python3

from openrgb import OpenRGBClient
from openrgb.utils import RGBColor, DeviceType

import psutil

client = OpenRGBClient()
ram = client.get_devices_by_type(DeviceType.DRAM)

while True:
    ram_use = int(psutil.virtual_memory()[2])
    loops = int((ram_use / 20) + 1)
    colour = 5 - loops

    for i in range(4, -1, -1):
        if loops > 0:
            ram[1].leds[x].set_color(RGBColor.fromHSV(colour * 24, 100, 100))
            ram[3].leds[x].set_color(RGBColor.fromHSV(colour * 24, 100, 100))
            ram[0].leds[x].set_color(RGBColor.fromHSV(colour * 24, 100, 100))
            ram[2].leds[x].set_color(RGBColor.fromHSV(colour * 24, 100, 100))
        else:
            ram[1].leds[x].set_color(RGBColor(0, 0, 0))
            ram[3].leds[x].set_color(RGBColor(0, 0, 0))
            ram[0].leds[x].set_color(RGBColor(0, 0, 0))
            ram[2].leds[x].set_color(RGBColor(0, 0, 0))
        loops = loops - 1