From ed40b186c9248c6f8f9d5c08d6248b8de85cef24 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Thu, 27 Jan 2022 11:04:52 +0100 Subject: [PATCH] Update 'set-wacom-draw-area' script --- .bin/set-wacom-draw-area | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.bin/set-wacom-draw-area b/.bin/set-wacom-draw-area index 6733193..06f6262 100755 --- a/.bin/set-wacom-draw-area +++ b/.bin/set-wacom-draw-area @@ -10,17 +10,20 @@ # # Drawing area +# TODO: w,h,x,y parameters w/ these defaults +# call script from autorandr with corresponding parameters. # -w=1920 # Width -h=1080 # Height -x=1920 # Horizontal offset -y=1080 # Vertical offset -orientation="landscape" # Portrait/landscape - # Get screen resolution (TODO: test external monitor) -resolution=$(xrandr --current | grep "connected primary" | awk '{print $4}') -echo "$resolution" +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 +h=1080 # Height +x="$((screen_w - 1920))" # Horizontal offset +y="$((screen_h - 1080))" # Vertical offset +orientation="landscape" # Portrait/landscape # Get rotation setting rotate=`[[ "$orientation" == "landscape" ]] && echo "half" || echo "ccw"`