Write scripts for setting up wacom tablet and maptool
This commit is contained in:
11
.config/systemd/user/wacom.service
Normal file
11
.config/systemd/user/wacom.service
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Configure Wacom tablet
|
||||
After=graphical-session.target
|
||||
PartOf=graphical-session.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/home/chris/.local/bin/initwacom
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical-session.target
|
||||
30
.local/bin/initwacom
Executable file
30
.local/bin/initwacom
Executable 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"
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user