scripts/x61t/autotorate
2024-02-05 22:48:49 +01:00

21 lines
503 B
Bash

#!/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