Browse Source

Generalize wacom config script output selection

Frans Bergman 4 years ago
parent
commit
2d4d18d15c
1 changed files with 5 additions and 3 deletions
  1. 5 3
      .scripts/wacom_conf.sh

+ 5 - 3
.scripts/wacom_conf.sh

@@ -10,11 +10,13 @@ ID=$(xsetwacom --list | gawk 'match($0, /id: ([0-9]+).*STYLUS/, a) {print a[1]}'
 
 case $CHOICE in
     osu)
-        xsetwacom set $ID Area 0 0 $(calc 2560 \* 3) $(calc 1440 \* 3)
+        xsetwacom set "$ID" Area 0 0 "$(calc 2560 \* 3)" "$(calc 1440 \* 3)"
         ;;
     drawing)
-        xsetwacom set $ID Area 0 0 21600 $(calc 21600 \* 1440 / 2560)
+        xsetwacom set "$ID" Area 0 0 21600 "$(calc 21600 \* 1440 / 2560)"
         ;;
 esac
 
-xsetwacom set $ID MapToOutput DisplayPort-1
+OUTPUT="$(xrandr --listactivemonitors | awk '{ print $4 }' | dmenu -i -b)"
+
+xsetwacom set "$ID" MapToOutput "$OUTPUT"