1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 21:18:36 -06:00
random/huion-tablet-setup.sh

36 lines
1.6 KiB
Bash
Raw Normal View History

2021-12-28 02:54:26 -06:00
#!/bin/sh
2021-11-26 01:46:41 -06:00
# Steps for setting up the drivers of Huion Inspiroy H640P
# git clone https://github.com/Huion-Linux/DIGImend-kernel-drivers-for-Huion
# cd DIGImend-kernel-drivers-for-Huion
2021-11-30 12:23:42 -06:00
# sed -i 's/SUBDIRS=/M=/' Makefile (only for arch or related)
2021-11-26 01:46:41 -06:00
# sudo make dkms_install
# Make /etc/udev/rules.d/00-usb-huion.rules with this content (to run it whenever the tabler is conencted):
2021-11-29 23:23:53 -06:00
# ACTION=="add", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", ENV{XAUTHORITY}="/home/sintan/.Xauthority", ENV{DISPLAY}=":0", OWNER=<user>, RUN+="/usr/local/bin/huion-tablet-mount"
# Make /usr/local/bin/huion-tablet-mount with this content :
2021-12-28 02:54:26 -06:00
# #!/bin/sh
2022-01-13 12:04:50 -06:00
#
# <location-of-this-script> & exit
2021-11-26 01:46:41 -06:00
# Make sure to install xf86-input-wacom (might have to restart)
2021-11-30 12:23:42 -06:00
# Add this script to autostart of your DE or .profile or somehow make it run at boot (so that it works in case the tablet is connected at boot)
2021-11-26 01:46:41 -06:00
2022-01-13 12:04:50 -06:00
if [ "$(xsetwacom --list | grep -c 'HID 256c:006d')" -ne "2" ]; then
echo "No supported devices found!"
exit 1
2022-01-10 21:58:08 -06:00
fi
sleep 1
2021-12-02 11:36:32 -06:00
xsetwacom --set 'HID 256c:006d Pen stylus' Button 2 "2" # middle mouse button
xsetwacom --set 'HID 256c:006d Pen stylus' Button 3 "3" # right mouse button
xsetwacom --set 'HID 256c:006d Pad pad' Button 1 "key +ctrl +s -s -ctrl" # save
xsetwacom --set 'HID 256c:006d Pad pad' Button 2 "key +alt +c -c -alt" # cycle colors in xournal++
xsetwacom --set 'HID 256c:006d Pad pad' Button 3 "4" # scroll up
xsetwacom --set 'HID 256c:006d Pad pad' Button 8 "5" # scroll down
xsetwacom --set 'HID 256c:006d Pad pad' Button 9 "key +ctrl +z -z -ctrl" # undo
xsetwacom --set 'HID 256c:006d Pad pad' Button 10 "key +ctrl +y -y -ctrl" # redo