Update 'set-wacom-draw-area' script

master
Hektor Misplon 2022-01-27 11:04:52 +01:00
parent 6ebc4adccb
commit ed40b186c9
1 changed files with 11 additions and 8 deletions

View File

@ -10,18 +10,21 @@
# #
# Drawing area # Drawing area
# TODO: w,h,x,y parameters w/ these defaults
# call script from autorandr with corresponding parameters.
# #
# Get screen resolution (TODO: test external monitor)
resolution=$(xrandr --current | grep "connected primary" | awk '{print $4}' | sed 's/x/ /g' | sed 's/+[0-9]//g')
screen_w=$(echo "$resolution" | awk '{print $1}')
screen_h=$(echo "$resolution" | awk '{print $2}')
w=1920 # Width w=1920 # Width
h=1080 # Height h=1080 # Height
x=1920 # Horizontal offset x="$((screen_w - 1920))" # Horizontal offset
y=1080 # Vertical offset y="$((screen_h - 1080))" # Vertical offset
orientation="landscape" # Portrait/landscape orientation="landscape" # Portrait/landscape
# Get screen resolution (TODO: test external monitor)
resolution=$(xrandr --current | grep "connected primary" | awk '{print $4}')
echo "$resolution"
# Get rotation setting # Get rotation setting
rotate=`[[ "$orientation" == "landscape" ]] && echo "half" || echo "ccw"` rotate=`[[ "$orientation" == "landscape" ]] && echo "half" || echo "ccw"`