wacom_conf.sh 476 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. CHOICE=$(dmenu -i -b << EOF
  3. osu
  4. drawing
  5. EOF
  6. )
  7. ID=$(xsetwacom --list | gawk 'match($0, /id: ([0-9]+).*STYLUS/, a) {print a[1]}')
  8. case $CHOICE in
  9. osu)
  10. xsetwacom set "$ID" Area 0 0 "$(calc 2560 \* 3)" "$(calc 1440 \* 3)"
  11. ;;
  12. drawing)
  13. xsetwacom set "$ID" Area 0 0 21600 "$(calc 21600 \* 1440 / 2560)"
  14. ;;
  15. esac
  16. OUTPUT="$(xrandr --listactivemonitors | awk '{ print $4 }' | dmenu -i -b)"
  17. xsetwacom set "$ID" MapToOutput "$OUTPUT"