Skip to content

Commit a3bcede

Browse files
committed
rgbkbd: Add sample script for --rgbkbd command
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent 04d3ceb commit a3bcede

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

rgbkbd.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env python3
2+
# Example invocation in fish shell
3+
# cargo build && sudo ./target/debug/framework_tool \
4+
# --driver portio --has-mec false --pd-ports 1 1 --pd-addrs 64 64 \
5+
# (./rgbkbd.py | string split ' ')
6+
7+
BRIGHTNESS = 1
8+
RED = int(0xFF * BRIGHTNESS) << 16
9+
GREEN = int(0xFF * BRIGHTNESS) << 8
10+
BLUE = int(0xFF * BRIGHTNESS)
11+
CYAN = GREEN + BLUE
12+
YELLOW = RED + GREEN
13+
PURPLE = BLUE + RED
14+
WHITE = RED + GREEN + BLUE
15+
16+
grid_4x4 = [
17+
[ YELLOW, RED, RED, RED, YELLOW ],
18+
[ RED, WHITE, GREEN, WHITE, RED ],
19+
[ RED, GREEN, BLUE, GREEN, RED ],
20+
[ RED, WHITE, GREEN, WHITE, RED ],
21+
[ YELLOW, RED, RED, RED, YELLOW ],
22+
]
23+
24+
fan_8leds = [[
25+
# WHITE, CYAN, BLUE, GREEN, PURPLE, RED, YELLOW, WHITE
26+
RED, RED, RED, RED,
27+
GREEN, GREEN, GREEN, GREEN
28+
]]
29+
30+
# colors = grid_4x4
31+
colors = fan_8leds
32+
33+
print('--rgbkbd 0', end='')
34+
for row in colors:
35+
for col in row:
36+
print(' ', end='')
37+
print(col, end='')

0 commit comments

Comments
 (0)