move scripts for x61t

This commit is contained in:
rick 2024-02-05 22:48:49 +01:00
commit 6ca3f634c9
Signed by: Rick
GPG key ID: 5CBE8779CD27BCBA
4 changed files with 2 additions and 0 deletions

21
x61t/autotorate Normal file
View file

@ -0,0 +1,21 @@
#!/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

52
x61t/rotateFunction Normal file
View file

@ -0,0 +1,52 @@
#!/bin/bash
#*************************#
# rotateFunction #
# #
# author: rick@gnous.eu #
# licence: GPL3 #
#*************************#
# a modifier selon l'id du stylet trouvable dans la commande
# xsetwacom --list devices
idStylus=12
# Fonctions permettant de tourner l'écran et le stylet
# Chaque position a un code qui est mit dans le fichier $HOME/.bin/rotationmode
#
# position ecran | code
# ---------------|------
# normal | 0
# droite | 1
# inversé | 4
# gauche | 3
function normal {
echo 0 > $HOME/.bin/rotationmode
xrandr -o normal
xsetwacom set $idStylus Rotate none
}
function right {
echo 1 > $HOME/.bin/rotationmode
xrandr -o right
xsetwacom set $idStylus Rotate cw
}
function inverted {
echo 4 > $HOME/.bin/rotationmode
xrandr -o inverted
xsetwacom set $idStylus Rotate half
}
function left {
echo 3 > $HOME/.bin/rotationmode
xrandr -o left
xsetwacom set $idStylus Rotate ccw
}
if [ $# -eq 0 ]; then
normal
else
$1 2> /dev/null
fi

24
x61t/rotatebutton Normal file
View file

@ -0,0 +1,24 @@
#!/bin/bash
#*************************#
# rotatebutton #
# #
# author: rick@gnous.eu #
# licence: GPL3 #
#*************************#
mode=$(cat $HOME/.bin/rotationmode)
case $mode
0)
rotateFunction right
;;
1)
rotateFunction inverted
;;
4)
rotateFunction left
;;
*)
rotateFunction
;;
esac