Hello guys!
I have one script, which rotate screen with wacom device counterclockwise.
On my X200t I bind this one to rotate-key on Windows (under display). So, I think it must be usefull in tablet mode.
Can anyone test it and give feedback plz?
https://github.com/Punkoivan/LinuxScript.git
Thanks =)
Take a look at our
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message
Screen rotation script for Wacom
-
evening_hunger
- Junior Member

- Posts: 306
- Joined: Thu Nov 26, 2015 2:55 pm
- Location: Normandy, France
Re: Screen rotation script for Wacom
[Glory to Ukraine!]
Makes sense to me. However, I've never used Wacom stylus. Nevertheless, I decided to reply and complicate your life
I don't know about x220t, but on my x220 I have succesfully tested a following script to autorotate the xrandr screen when the accelerometer says so:
I presume you could play with that:) As you can see, /sys/devices/platform/hdaps/position is the place to go for the laptop orientation coordinates.
That is of course if the hdaps module is loaded in the kernel!
Coming back to your script, I should probably follow your example and put 'case' instructions, always safer than nested ifs...
best regards:)
Makes sense to me. However, I've never used Wacom stylus. Nevertheless, I decided to reply and complicate your life
I don't know about x220t, but on my x220 I have succesfully tested a following script to autorotate the xrandr screen when the accelerometer says so:
Code: Select all
#!/bin/bash
#Adaptex from x220 tablet using Arch wiki (https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X200https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X200)
#2015/12/01 (changes: set to x only for now, update xrandr syntax, dump rotate function)
while true; do
# 1) We extract data about the actual position
position=$(cat /sys/devices/platform/hdaps/position)
x=$(echo $position | sed -n "s/(\([-0-9]*\),\([-0-9]*\).*)/\1/p") # most of time contained in [350,650]
y=$(echo $position | sed -n "s/(\([-0-9]*\),\([-0-9]*\).*)/\2/p") # most of time contained in [-650,-350]
# 2) We work out the x value (= left and right inclination) (always between
if [ $x -lt 400 ]; then
xrandr --output LVDS1 --rotate right
elif [ $x -gt 600 ]; then
xrandr --output LVDS1 --rotate left
else
xrandr --output LVDS1 --rotate normal
fi
# #3) We work out the y value (= front and back inclination)
# if [ $y -gt -400 ]; then
# xrandr --output LVDS1 --rotate inverted
# elif [ $y -lt -600 ]; then
# xrandr --output LVDS1 --rotate normal
# fi
# 4) wait before checking the value again
sleep 0.5
done
That is of course if the hdaps module is loaded in the kernel!
Coming back to your script, I should probably follow your example and put 'case' instructions, always safer than nested ifs...
best regards:)
T14amdR7-4750U/32GB/500gb.ssd/debian_testing (main driver)
X320/i7-2620M/8GB/256gb.ssd/FHD13.3''IPS/debian_testing (ex-main driver)
T30Pentium-M 4 1.8Ghz 512MB RAM - under restoration
X230/i5/8GB/500gb.hdd+256gb.m2ssd/IPS/debian_stable+win7
755CE, 486DX, approx 28MB RAM (Win95 JP)
X320/i7-2620M/8GB/256gb.ssd/FHD13.3''IPS/debian_testing (ex-main driver)
T30Pentium-M 4 1.8Ghz 512MB RAM - under restoration
X230/i5/8GB/500gb.hdd+256gb.m2ssd/IPS/debian_stable+win7
755CE, 486DX, approx 28MB RAM (Win95 JP)
Re: Screen rotation script for Wacom
Hi!
Yeah, I saw some of autorotate scripts (even may be on Archwiki), but it useless for me for one reason :
it can't correct position when I lying on back =)
Such as other touchscreen device.
May be its possible to find value that comfortable for me.
I'll try this one, thnx!
cheers, Ivan.
P.S. Yes, I've HDAPS, it's cool.
I don't use this sensor for HDD, because SSD in my laptop, but it really interesting play neverball or Tuxkart via accelerometer =)
Yeah, I saw some of autorotate scripts (even may be on Archwiki), but it useless for me for one reason :
it can't correct position when I lying on back =)
Such as other touchscreen device.
May be its possible to find value that comfortable for me.
I'll try this one, thnx!
cheers, Ivan.
P.S. Yes, I've HDAPS, it's cool.
I don't use this sensor for HDD, because SSD in my laptop, but it really interesting play neverball or Tuxkart via accelerometer =)
-
- Similar Topics
- Replies
- Views
- Last post
-
-
T480 screen shuts off after a few seconds to a minute after starting to use it.
by FranklinHawkings » Wed Oct 22, 2025 5:26 pm » in ThinkPad T430-T495 / T530-T590 Series - 13 Replies
- 29839 Views
-
Last post by RealBlackStuff
Sat Nov 01, 2025 12:09 am
-
-
-
Complete screen and lid swap between two X220 one IPS and one not
by Tired » Sat Oct 25, 2025 6:40 am » in ThinkPad X200/X201/X220 and X300/X301 Series - 4 Replies
- 27431 Views
-
Last post by axur-delmeria
Sat Oct 25, 2025 8:30 am
-
-
- 2 Replies
- 19216 Views
-
Last post by mvaudio
Sun Nov 02, 2025 9:57 am
-
-
T530 Screen Upgrade to FHD Panel - Which Panel?
by Silverlake » Wed Dec 17, 2025 3:39 pm » in ThinkPad T430-T495 / T530-T590 Series - 0 Replies
- 8993 Views
-
Last post by Silverlake
Wed Dec 17, 2025 3:39 pm
-
Who is online
Users browsing this forum: No registered users and 20 guests



