Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #coding:utf8
- export DISPLAY=:1
- export XAUTHORITY=/run/user/1000/gdm/Xauthority
- # Make a subshell
- (
- # Loop until devices are present
- for ((retries=0; retries<10; retries++)); do
- # break if device is present
- xsetwacom --list devices | grep -q "Wacom Intuos BT S Pad" && break
- sleep 1
- done
- # Sleep a second to make sure additional devices are present
- sleep 1
- if ! xsetwacom --list devices | grep -q "Wacom Intuos BT S Pad"; then
- xmessage "Devices not present after timeout"
- exit 0 # Not sure if exit 1 would cause any issues
- fi
- main_screen="HEAD-0"
- bezier_args="0 20 80 100"
- positioning_mode="Absolute"
- # Maps the graphics tablet to the area of a specified screen (for multiple-screen environments).
- xsetwacom set "Wacom Intuos BT S Pen stylus" MapToOutput "$main_screen"
- xsetwacom set "Wacom Intuos BT S Pen eraser" MapToOutput "$main_screen"
- # Changes the pressure sensitivity.
- xsetwacom set "Wacom Intuos BT S Pen stylus" PressureCurve "$bezier_args"
- xsetwacom set "Wacom Intuos BT S Pen eraser" PressureCurve "$bezier_args"
- # Specifies the positioning mode ("Absolute" / "Relative")
- xsetwacom set "Wacom Intuos BT S Pen stylus" Mode "$positioning_mode"
- xsetwacom set "Wacom Intuos BT S Pen eraser" Mode "$positioning_mode"
- # Assigns actions to the tablet buttons.
- xsetwacom set "Wacom Intuos BT S Pad pad" Button 1 "key +ctrl z -ctrl"
- xsetwacom set "Wacom Intuos BT S Pad pad" Button 2 "key +ctrl +shift z -ctrl -shift"
- ) &
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement