-
Notifications
You must be signed in to change notification settings - Fork 0
/
g513_keyboard_led
executable file
·189 lines (181 loc) · 7.69 KB
/
g513_keyboard_led
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#!/bin/env bash
ini_path="/home/andre/Scripts/Programs/assorted-scripts"
source <(grep = $ini_path/g513_keyboard_ID.ini)
while getopts "sgvwmc" opt; do
case ${opt} in
s ) COLOR="sxhkd";;
g ) COLOR="game";;
v ) COLOR="vim";;
w ) COLOR="wave";;
m ) COLOR="manuel";;
c ) COLOR="cycles";;
/? ) echo "Invalid Option: "; exit 1;;
esac
done
SCRIPTS=00ffff
DMENU_SCRIPTS=1212ff
PROGRAMS=ff00ff
SYSTEM=ff7c00
MOVEMENT=ffff00
DESKTOPS=991212
NUM_NUM=ff7c00
NUM_OP=00ff7c
MUSIC=129912
OTHER=00ff7c
REST=727272
SPECIAL=ffff00
function set_all() {
g513-led -dv $VendorID -dp $ProductID -tuk 1 -a $1
}
function set_individual() {
g513-led -dv $VendorID -dp $ProductID -k $1 $2
}
case $COLOR in
game )
set_all "9090ff" #Sett #9090ff på alle tastene
set_individual "W" "ff00ff"
set_individual "A" "ff7c00"
set_individual "S" "ff0000"
set_individual "D" "00ffff"
set_individual "top" "ff00ff"
set_individual "bottom" "ff0000"
set_individual "left" "ff7c00"
set_individual "right" "00ffff"
set_individual "shift_left" "00ff00"
set_individual "shift_right" "00ff00"
set_individual "space" "00ff00"
set_individual "ctrl_left" "00ff00"
set_individual "ctrl_right" "00ff00"
set_individual "alt_left" "00ff00"
set_individual "alt_right" "00ff00" ;;
vim )
set_all "f0ff0f"
set_individual "period" "f0ff0f"
set_individual "winleft" "f0ff0f"
set_individual "shift_left" "f0ff0f"
set_individual "shift_right" "f0ff0f"
set_individual "A" "f0ff0f"
set_individual "Y" "f0ff0f"
set_individual "D" "f0ff0f"
set_individual "0" "f0ff0f"
set_individual "P" "f0ff0f"
set_individual "I" "f0ff0f"
set_individual "O" "f0ff0f"
set_individual "escape" "f0ff0f"
set_individual "C" "f0ff0f"
set_individual "W" "f0ff0f"
set_individual "U" "f0ff0f"
set_individual "X" "f0ff0f"
set_individual "H" "ff7c00"
set_individual "J" "ff0000"
set_individual "K" "ff00ff"
set_individual "L" "00ffff"
set_individual "top" "ff00ff"
set_individual "bottom" "ff0000"
set_individual "left" "ff7c00"
set_individual "right" "00ffff"
set_individual "ctrl_left" "f0ff0f"
set_individual "ctrl_right" "f0ff0f"
set_individual "V" "f0ff0f"
set_individual "backslash" "f0ff0f"
set_individual "Q" "f0ff0f"
set_individual "Z" "f0ff0f" ;;
sxhkd )
set_all "$REST"
# Desktops
set_individual "1" "$DESKTOPS"
set_individual "2" "$DESKTOPS"
set_individual "3" "$DESKTOPS"
set_individual "4" "$DESKTOPS"
set_individual "5" "$DESKTOPS"
set_individual "6" "$DESKTOPS"
set_individual "7" "$DESKTOPS"
set_individual "8" "$DESKTOPS"
set_individual "9" "$DESKTOPS"
set_individual "0" "$DESKTOPS"
# Movement
set_individual "H" "$MOVEMENT"
set_individual "J" "$MOVEMENT"
set_individual "K" "$MOVEMENT"
set_individual "L" "$MOVEMENT"
set_individual "top" "$MOVEMENT"
set_individual "bottom" "$MOVEMENT"
set_individual "left" "$MOVEMENT"
set_individual "right" "$MOVEMENT"
# Dmenu Scripts
set_individual "P" "$DMENU_SCRIPTS"
set_individual "Z" "$DMENU_SCRIPTS"
set_individual "O" "$DMENU_SCRIPTS"
set_individual "U" "$DMENU_SCRIPTS"
set_individual "S" "$DMENU_SCRIPTS"
set_individual "I" "$DMENU_SCRIPTS"
set_individual "A" "$DMENU_SCRIPTS"
set_individual "C" "$DMENU_SCRIPTS"
set_individual "B" "$DMENU_SCRIPTS"
set_individual "W" "$DMENU_SCRIPTS"
set_individual "M" "$DMENU_SCRIPTS"
set_individual "comma" "$DMENU_SCRIPTS"
set_individual "period" "$DMENU_SCRIPTS"
set_individual "F8" "$DMENU_SCRIPTS"
set_individual "print" "$DMENU_SCRIPTS"
# Programs
set_individual "T" "$PROGRAMS"
set_individual "F" "$PROGRAMS"
set_individual "E" "$PROGRAMS"
set_individual "V" "$PROGRAMS"
set_individual "X" "$PROGRAMS"
set_individual "F1" "$PROGRAMS"
set_individual "F2" "$PROGRAMS"
# Special
set_individual "escape" "$SPECIAL"
set_individual "winleft" "$SPECIAL"
# Scripts
set_individual "G" "$SCRIPTS"
set_individual "F3" "$SCRIPTS"
set_individual "F4" "$SCRIPTS"
set_individual "Y" "$SCRIPTS"
set_individual "N" "$SCRIPTS"
set_individual "D" "$SCRIPTS"
# System
set_individual "shift_left" "$SYSTEM"
set_individual "ctrl_left" "$SYSTEM"
set_individual "alt_left" "$SYSTEM"
set_individual "Q" "$SYSTEM"
set_individual "R" "$SYSTEM"
set_individual "tab" "$SYSTEM"
# Music
set_individual "F9" "$MUSIC"
set_individual "F10" "$MUSIC"
set_individual "F11" "$MUSIC"
set_individual "F12" "$MUSIC"
# NUM
set_individual "num0" "$NUM_NUM"
set_individual "num1" "$NUM_NUM"
set_individual "num2" "$NUM_NUM"
set_individual "num3" "$NUM_NUM"
set_individual "num4" "$NUM_NUM"
set_individual "num5" "$NUM_NUM"
set_individual "num6" "$NUM_NUM"
set_individual "num7" "$NUM_NUM"
set_individual "num8" "$NUM_NUM"
set_individual "num9" "$NUM_NUM"
set_individual "num_lock" "$NUM_OP"
set_individual "num_slash" "$NUM_OP"
set_individual "num_asterisk" "$NUM_OP"
set_individual "num_minus" "$NUM_OP"
set_individual "num_plus" "$NUM_OP"
set_individual "numenter" "$NUM_OP"
set_individual "num_dot" "$NUM_OP"
set_individual "insert" "$NUM_OP"
set_individual "delete" "$NUM_OP"
set_individual "home" "$NUM_OP"
set_individual "end" "$NUM_OP"
set_individual "page_up" "$NUM_OP"
set_individual "page_down" "$NUM_OP" ;;
wave )
g513-led -dv $VendorID -dp $ProductID -fx cwave all 5 ;;
manuel )
g513-led -dv $VendorID -dp $ProductID -tuk 1 -a $( yad --color | tail -c 7 ) ;;
cycles )
g513-led -dv $VendorID -dp $ProductID -fx cycle all 20 ;;
esac