diff options
author | davidovski <david@davidovski.xyz> | 2021-10-09 22:58:10 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2021-10-09 22:58:10 +0100 |
commit | 49fff5a029e08f31941c75c19a72d7e7eb1ed172 (patch) | |
tree | 9cab74542e7302f47a9b8efbe5b1c674f9eb2150 /scripts/.scripts/tablet | |
parent | 26d3e9c0db0b8591eba24de5437b3c75d9995064 (diff) |
fixed scripts
Diffstat (limited to 'scripts/.scripts/tablet')
-rwxr-xr-x | scripts/.scripts/tablet | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/scripts/.scripts/tablet b/scripts/.scripts/tablet deleted file mode 100755 index 6702ace..0000000 --- a/scripts/.scripts/tablet +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/python -import sys - -#Arguments -dev = sys.argv[1] -prop = sys.argv[2] -scale = float(sys.argv[3]) -tablet_ratio = (lambda s: float(s[0]) / float(s[1]))(sys.argv[4].split(":")) if len(sys.argv) > 4 else 16/9 - -#Layout of screens: (x, y, w, h) -screens = [ - (0,0, 1080, 1920), - (1080, 0, 2560, 1440), - (3640, 208, 1280, 1024), -] - -#TODO find this with xrandr - -target = screens[1] - -#Physical offset of the selected screen -offsetx = target[0] -offsety = target[1] - -#Size of the full screen areas -sh = 1920 -sw = 1280 + 2560 + 1080 -#TODO calculate using list of screens - -#Aspect ratio of the tablet, to avoid weird scaling problems - -#Size of the tablet -#Prioritize the with when scaling between aspect ratios -tw = target[2] -th = tw / tablet_ratio -print(tw, "x", th) - -#make a variable that will try to make the scale the same over diferent resoultions -f = target[3] / target[3] -print ("f value =", f) - -#calculate the new area size -aw = tw * scale * f -ah = th * scale * f - -ox = (target[2] - aw) / 2 + offsetx -oy = (target[3] - ah) / 2 + offsety -#ox = offsetx -#oy = offsety - - -c0 = aw / sw -c2 = ah / sh -c1 = ox / sw -c3 = oy / sh - -print(str(c0), "0", str(c1), "0", str(c2), str(c3), "0 0 1") - -import os -os.system(" ".join(["xinput set-prop", dev, prop, str(c0), "0", str(c1), "0", str(c2), str(c3), "0 0 1"])) -#alias tablet2="xinput set-prop 18 156 2.45 0 -0.725 0 2.45 -0.725 0 0 1" |