scripts/x61t/autotorate

22 lines
503 B
Text
Raw Permalink Normal View History

2024-02-05 22:46:30 +01:00
#!/bin/bash
#*************************#
# autotorate #
# #
# author: rick@gnous.eu #
# licence: GPL3 #
#*************************#
while [ 1 ]
do
state=$(cat /sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode)
rotateState=$(cat $HOME/.bin/rotationmode)
if [ $state -eq 0 ] && [ $rotateState -eq 4 ]
then
rotateFunction
elif [ $state -eq 1 ] && [ $rotateState -eq 0 ]
then
rotateFunction inverted
fi
done