Write scripts for setting up wacom tablet and maptool

This commit is contained in:
2021-04-16 14:38:33 +01:00
parent 6516ff47b9
commit 4c6652a20f
4 changed files with 50 additions and 0 deletions

30
.local/bin/initwacom Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
for i in $(seq 10); do
if xsetwacom list devices | grep -q Wacom; then
break
fi
sleep 1
done
list=$(xsetwacom list devices)
pad=$(echo "${list}" | awk '/pad/{print $8}')
stylus=$(echo "${list}" | awk '/stylus/{print $8}')
eraser=$(echo "${list}" | awk '/eraser/{print $8}')
if [ -z "${pad}" ]; then
exit 0
fi
xsetwacom set "${stylus}" MapToOutput DisplayPort-1
xsetwacom set "${eraser}" MapToOutput DisplayPort-1
xsetwacom set "${stylus}" Area "0 0 31496 17716"
xsetwacom set "${eraser}" Area "0 0 31496 17716"
xsetwacom set "${pad}" Button 11 "key +ctrl z -ctrl"
xsetwacom set "${pad}" Button 10 "key +shift"
xsetwacom set "${pad}" Button 9 "key +ctrl"
xsetwacom set "${pad}" Button 1 "button +15"
#xsetwacom set "${pad}" Button 4 "key 0xffad"
#xsetwacom set "${pad}" Button 4 "button +5"

View File

@@ -0,0 +1,4 @@
#! /bin/bash
# Scale up the GUI by 2 times for HiDPI screens
sed -i '/\[JavaOptions\]/a -Dsun.java2d.uiScale=2' /opt/maptool/lib/app/MapTool.cfg

View File

@@ -0,0 +1,5 @@
#! /bin/bash
tee /etc/udev/rules.d/99-wacom.rules <<EOF
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="056a", TAG+="systemd". ENV{SYSTEMD_USER_WANTS}+="wacom.service"
EOF