Advertisement
Guest User

Untitled

a guest
Jan 7th, 2020
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. #!/bin/bash
  2. #coding:utf8
  3.  
  4. export DISPLAY=:1
  5. export XAUTHORITY=/run/user/1000/gdm/Xauthority
  6.  
  7. # Make a subshell
  8. (
  9. # Loop until devices are present
  10. for ((retries=0; retries<10; retries++)); do
  11. # break if device is present
  12. xsetwacom --list devices | grep -q "Wacom Intuos BT S Pad" && break
  13.  
  14. sleep 1
  15. done
  16.  
  17. # Sleep a second to make sure additional devices are present
  18. sleep 1
  19.  
  20. if ! xsetwacom --list devices | grep -q "Wacom Intuos BT S Pad"; then
  21. xmessage "Devices not present after timeout"
  22. exit 0 # Not sure if exit 1 would cause any issues
  23. fi
  24.  
  25. main_screen="HEAD-0"
  26. bezier_args="0 20 80 100"
  27. positioning_mode="Absolute"
  28.  
  29. # Maps the graphics tablet to the area of a specified screen (for multiple-screen environments).
  30. xsetwacom set "Wacom Intuos BT S Pen stylus" MapToOutput "$main_screen"
  31. xsetwacom set "Wacom Intuos BT S Pen eraser" MapToOutput "$main_screen"
  32.  
  33. # Changes the pressure sensitivity.
  34. xsetwacom set "Wacom Intuos BT S Pen stylus" PressureCurve "$bezier_args"
  35. xsetwacom set "Wacom Intuos BT S Pen eraser" PressureCurve "$bezier_args"
  36.  
  37. # Specifies the positioning mode ("Absolute" / "Relative")
  38. xsetwacom set "Wacom Intuos BT S Pen stylus" Mode "$positioning_mode"
  39. xsetwacom set "Wacom Intuos BT S Pen eraser" Mode "$positioning_mode"
  40.  
  41. # Assigns actions to the tablet buttons.
  42. xsetwacom set "Wacom Intuos BT S Pad pad" Button 1 "key +ctrl z -ctrl"
  43. xsetwacom set "Wacom Intuos BT S Pad pad" Button 2 "key +ctrl +shift z -ctrl -shift"
  44. ) &
  45.  
  46. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement