move scripts for x61t
This commit is contained in:
parent
98379dfbea
commit
6ca3f634c9
4 changed files with 2 additions and 0 deletions
21
x61t/autotorate
Normal file
21
x61t/autotorate
Normal 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
52
x61t/rotateFunction
Normal 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
24
x61t/rotatebutton
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue