From 24f2f9f6c6866a1d2e02fb8fdd7fc752508aba9a Mon Sep 17 00:00:00 2001 From: Riyyi Date: Tue, 20 Jul 2021 22:41:44 +0200 Subject: [PATCH] Round offset number for xsetwacom input --- .local/bin/inputctl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/inputctl b/.local/bin/inputctl index 5fd9b41..96c6e3d 100755 --- a/.local/bin/inputctl +++ b/.local/bin/inputctl @@ -164,7 +164,7 @@ tablet() { case "$1" in ccw) calculatedWidth=$(calc "$tabletHeight * $screenHeight / $screenWidth") - offsetWidth=$(calc "($tabletWidth - $calculatedWidth) / 2") + offsetWidth=$(calc "($tabletWidth - $calculatedWidth) / 2" | cut -d '.' -f 1) calculatedWidth=$(calc "$calculatedWidth + $offsetWidth" | cut -d '.' -f 1) xsetwacom set "$2" Area "$offsetWidth" 0 "$calculatedWidth" "$tabletHeight" @@ -172,7 +172,7 @@ tablet() { ;; normal) calculatedHeight=$(calc "$tabletWidth * $screenHeight / $screenWidth" | cut -d '.' -f 1) - offsetHeight=$(calc "($tabletHeight - $calculatedHeight) / 2") + offsetHeight=$(calc "($tabletHeight - $calculatedHeight) / 2" | cut -d '.' -f 1) xsetwacom set "$2" Area 0 "$offsetHeight" "$tabletWidth" "$calculatedHeight" ;;