Skip to content

Instantly share code, notes, and snippets.

@ebrensi
ebrensi / stylus-rotate.sh
Created May 2, 2019 19:19
Automatic Stylus (Pen) Rotate Orientation
#!/bin/sh
# Automatic stylus (pen) orientation for HP Spectre x360
# adapted by Efrem Rensi
# This is a fix for an apparent bug in Cinnamon whereby System Settings >> General >> Automatic Screen Rotation
# Rotates the screen and touch functionality, but the pen orientation does not rotate
# Based on chadm's script at https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu.
# Receives input from monitor-sensor (part of iio-sensor-proxy package) and sets the touchscreen
# orientation based on the accellerometer positionn. We assume that the display rotation is