-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeycolors
36 lines (34 loc) · 894 Bytes
/
keycolors
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
#!/bin/bash
#----------
# A script for coordinating your msi keyboard's LEDs with your Xresources color
# scheme.
#
# Requirements
# ============
# msi-perkeyrgb: https://github.com/Askannz/msi-perkeyrgb
#
# Recommendations
# ===============
# Edit your sudoers file to allow using the msi-perkeyrb command without a
# password.
#
# Example1:
# bob ALL=(ALL) ALL, NOPASSWD: /usr/bin/msi-perkeyrgb
#
# Example2:
# Cmnd_Alias MSI = /usr/bin/msi-perkeyrgb
# bob ALL=(ALL) ALL, NOPASSWD: MSI
#
# Configuration
# =============
# Supported models: ge6, ge73, ge75, gl63, gs63, gs65, gs75, gt63, gt75
MSI_MODEL=""
# Supports any value from 0 to 15
X_RESOURCES_COLOR_NUM=
# End of Configuration
COLOR_HEX=$(
xrdb -query |
grep "^[^.]color$[X_RESOURCES_COLOR_NUM][^0-9].*$" |
sed '$s/.*#//g' |
tr '[:upper:]' '[:lower:]')
sudo msi-perkeyrgb -m $MSI_MODEL -s $COLOR_HEX