forked from RaulPPelaez/Naga_KeypadMapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnagastart.sh
20 lines (18 loc) · 789 Bytes
/
nagastart.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
sleep 1
# All supported devices listed in README. If you want to add another device, please check the naga.cpp source code!
NAGAID1=$(xinput | grep Naga | grep keyboard | cut -d= -f2 | cut -b1-2)
xinput set-int-prop $NAGAID1 "Device Enabled" 8 0
# Insanity, just because naga 2014
NAGAID2=$(xinput | grep Naga | grep pointer | cut -d= -f2 | cut -f1)
if [[ `echo $NAGAID2 | wc -w` -eq 2 ]]; then
if [[ `xinput get-button-map $(echo $NAGAID2 | awk '{print $1}') | grep 10 | wc -l` -eq 1 ]]; then
xinput set-button-map $(echo $NAGAID2 | awk '{print $1}') 1 2 3 4 5 6 7 11 10 8 9 13 14 15
else
xinput set-button-map $(echo $NAGAID2 | awk '{print $2}') 1 2 3 4 5 6 7 11 10 8 9 13 14 15
fi
else
xinput set-button-map $NAGAID2 1 2 3 4 5 6 7 11 10 8 9 13 14 15
fi
# Run daemon
naga