Created
October 9, 2024 08:12
-
-
Save malys/ca28a80eb2e02fdc7820fdd177b3c8b0 to your computer and use it in GitHub Desktop.
[Wacom tablet] configuration #wacom #bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sh | |
# Wacom Intuos BT S pad | |
# ___________________________________________ | |
# | _____________________________________ | | |
# | / | | | | \ | | |
# | | 0 | 1 | | 2 | 3 | | | |
# | \_______|________|____|_______|_______/ | | |
# | ___________________________________ | | |
# | | | | | |
# | | | | | |
# | | | | | |
# | | 0 - Button 1 | | | |
# | | 1 - Button 2 | | | |
# | | 2 - Button 3 | | | |
# | | 3 - Button 8 | | | |
# | | | | | |
# | | | | | |
# | | | | | |
# | |___________________________________| | | |
# | | | |
# |___________________________________________| | |
# | |
# | |
# Wacom Intuos BT S stylus | |
# ________ ___ | |
# ---------------------------------------/ 1 \/ 2 \--------\__ | |
# | _ > 3 | |
# --------------------------------------------------------------/ | |
# | |
# More info: | |
# http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Tablet_Configuration | |
# http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Wacom_Tablet_Configuration | |
# | |
# | |
# ## Set the script to auto-start in each session: | |
# | |
# # Place the script in ~/bin/.xsetwacom.sh | |
# # and make it executable: chmod +x ~/bin/.xsetwacom.sh | |
# | |
# # Go to you distribution's settings manager, find the section for the startup applications, | |
# # and add an entry for the following command "/home/<your-username>/bin/.xsetwacom.sh" | |
# # For Xubuntu, it's: Applications menu -> Settings -> Settings Manager -> | |
# # Session and Startup -> Application Autostart Tab -> Add -> | |
# # Name: xsetwacom config -> Command: /home/<your-username>/bin/.xsetwacom.sh | |
DEVICE="Wacom Intuos BT S" | |
STYLUS="$DEVICE Pen stylus" | |
ERASER="$DEVICE Pen eraser" | |
CURSOR="$DEVICE Pen cursor" | |
PAD="$DEVICE Pad pad" | |
FAILURE="1" | |
for i in $(seq 20); do | |
if xsetwacom --list devices | grep "$DEVICE" > /dev/null; then | |
FAILURE="0" | |
break | |
else | |
echo "Waiting for device $DEVICE" | |
sleep 1 | |
fi | |
done | |
if [ "$FAILURE" -eq 1 ]; then | |
exit 1 | |
fi | |
# Wacom Intuos BT S stylus | |
# The values set correspond to numbers on the X11 Mouse Button Numbering Scheme | |
# More: http://xahlee.info/linux/linux_x11_mouse_button_number.html | |
xsetwacom set "$STYLUS" Button 1 1 # Left Click | |
xsetwacom set "$STYLUS" Button 2 3 # Right Click | |
xsetwacom set "$STYLUS" Button 3 "button 1 button 1" # Left Double Click | |
# Wacom Intuos BT S pad | |
# xsetwacom set "$PAD" Button 1 "key +ctrl x -ctrl" # Cut | |
# xsetwacom set "$PAD" Button 2 "key +ctrl c -ctrl" # Copy | |
# xsetwacom set "$PAD" Button 3 "key +ctrl z -ctrl" # Undo | |
# xsetwacom set "$PAD" Button 8 "key +ctrl v -ctrl" # Paste | |
xsetwacom set "$PAD" Button 1 "key +ctrl z -ctrl" | |
xsetwacom set "$PAD" Button 2 "key +ctrl y -ctrl" | |
xsetwacom set "$PAD" Button 3 "key +ctrl m -ctrl" # Shortcut for mypaint | |
xsetwacom set "$PAD" Button 8 "key m" # reposition | |
# Monitor | |
# xrandr: list of screen | |
#MONITOR=HDMI-1 | |
MONITOR=LVDS-1 | |
ID_STYLUS=`xinput | grep "Pen stylus" | cut -f 2 | cut -c 4-5` | |
xinput map-to-output $ID_STYLUS $MONITOR | |
echo "Device $DEVICE has been configured" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment