Hyprland
Hyprland copied to clipboard
[WIP] Add tablets calibration matrix for dynamic rotation with 2-in1/tablet PC usage
Describe your PR, what does it fix/add?
Intends to add rotation support for touch-screen stylus (by adding calibration matrix support to tablets), so we can rotate the display + digitizer (touchscreen + stylus) based on device orientation (via acceleration sensor) on the fly with hyperctl (tablet/2-in-1).
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Only anecdotally tested (in one setup), not working yet (no noticable effect).
If you have a 2-in-1 with nixos this HM module should make testing trivial.
Is it ready for merging, or does it need work?
Still needs work. Cleanly builds and runs, but the tablet (stylus) calibration does not have any effect yet. I.e. somehow the changes are still ineffective. A bit short on time now, so I'll need to pick this up later. (Or maybe somebody has an idea?)
consider not making a MR with a bunch of unrelated stuff. Changes in cmakelists are plain wrong and out of place, so is .gitignore and submodule updates.
You also do a refactor of member names, which is NOT the point of this MR.
point taken => taken out. (those changes were conducive to code readibility/understanding but indeed not per se part of this topic)
@vaxerski after some refactoring and rebasing it seems to work well. I have not thoroughly tested but it works on my HP Spectre x360 touch screen in my nixos-config mentioned above.
That means I don't set any config on start, but my "rotation service" simply executes hyprctl commands with transform like so:
monitor-sensor \
| awk ' $4 ~ /bottom-up/ { print "2" }; $4 ~ /left-up/ { print "1" }; $4 ~ /normal/ { print "0" }; $4 ~ /right-up/ { print "3" }; { system("") };' \
| xargs -rI{} hyprctl --batch "keyword device:elan2514:00-04f3:29f5:transform {} ; keyword device:elan2514:00-04f3:29f5-stylus:transform {} ; keyword monitor eDP-1,transform,{}"
make a wiki pr plox