Installation MAGEIA Asus [Réglé]
ASUS T100TA
Système et matériels / Installation et configuration

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Reprise du message précédent
Peux tu essayer celui là ?Code BASH :
#!/bin/bash -x # Review 2019-04-19 by Jean-Baptiste Biernacki ## Review 2016-01-03 by John Wells ## https://github.com/jfwells/linux-asus-t100ta/blob/master/support-scripts/rotate.sh ### Based 2010-10-26 on an original by Maxwell Pray (synthead), from ### https://bbs.archlinux.org/viewtopic.php?id=107167 #For information : #xinput list #⎡ Virtual core pointer id=2 [master pointer (3)] #⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] #⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] #⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] #⎣ Virtual core keyboard id=3 [master keyboard (2)] # ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] # ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] # ↳ Video Bus id=7 [slave keyboard (3)] # ↳ Sleep Button id=8 [slave keyboard (3)] # ↳ Asus Keyboard id=9 [slave keyboard (3)] # ↳ Asus Keyboard id=10 [slave keyboard (3)] # ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] # ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] # ↳ gpio-keys id=15 [slave keyboard (3)] #Check dependencies : xinput if [ ${?} -ne 0 ]; then echo "Install xinput first." exit fi xrandr if [ ${?} -ne 0 ]; then echo "Install xrandr first." exit fi grep -a $0 /proc/sched_debug 2>/dev/null if [ ${?} -eq 0 ]; then echo "The script is already running!" exit fi #Normal transformation matrix # 1 0 0 # 0 1 0 # 0 0 1 T_Matrix_normal=" 1 0 0 0 1 0 0 0 1" #Left transformation matrix # 0 -1 1 # 1 0 0 # 0 0 1 T_Matrix_left=" 0 -1 1 1 0 0 0 0 1" #Inverted transformation matrix #-1 0 1 # 0 -1 1 # 0 0 1 T_Matrix_inverte="-1 0 1 0 -1 1 0 0 1" #Right transformation matrix # 0 1 0 #-1 0 1 # 0 0 1 T_Matrix_right=" 0 1 0 -1 0 1 0 0 1" #variables sNormal="normal" sLeft="left" sRight="right" sInverted="interved" vNormal=0 vLeft=1 vRight=3 vInverted=2 #Change s[[:alpha:]] to v[[:alpha:]] for switching from string to value : normal=${sNormal} left=${sLeft} right=${sRight} inverted=${sInverted} #List of input devices to rotate : #For the full available list, type : $ xinput list device1="Virtual core XTEST pointer" device2="Asus TouchPad" device3="SIS0817:00 0457:1071" #device4="bytcr-rt5640 Headset" #device5="" #The screen to rotate : #To know which screen is to rotate, type : $ xrandr | grep " connected" | sed "s/^\([[:alnum:]]*\)[[:space:]].*/\1/" screen="DSI1" #Time between two loops period=1 pointers="$(xinput list)" xinputs="" xinputs="${xinputs} $(echo ${pointers} | grep '${device1}' | sed 's/.*id=\([[:digit:]]*\).*/\1/g')" xinputs="${xinputs} $(echo ${pointers} | grep '${device2}' | sed 's/.*id=\([[:digit:]]*\).*/\1/g')" xinputs="${xinputs} $(echo ${pointers} | grep '${device3}' | sed 's/.*id=\([[:digit:]]*\).*/\1/g')" #xinputs="${xinputs} $(echo ${pointers} | grep '${device4}' | sed 's/.*id=\([[:digit:]]*\).*/\1/g')" #Set default setting for locked orientation: #Not implemented. #lockFile="/tmp/lockedOrientation" #echo "0" > ${lockFile} while true; do #Check if rotation is locked. #Not implemented. locked=0 #locked=$(cat ${lockFile}) if [ ${locked} -eq 0 ]; then #Get current orientation set currentOrientation=$(xrandr --verbose | grep ${screen} | sed -e "s/.*) \([[:alpha:]]*\) (.*/\1/") case ${currentOrientation} in ${sNormal} ) currentOrientation="${normal}" ;; ${sLeft} ) currentOrientation="${left}" ;; ${sInverted} ) currentOrientation="${inverted}";; ${sRight} ) currentOrientation="${right}" ;; * ) echo "bug.";; esac #Get data from accelerometer x=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_x_raw) y=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_y_raw) z=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw) nextRotation="${normal}" if [ $x -le 0 ]; then case $x in -???? ) nextRotation="${normal}";; -????? ) nextRotation="${right}";; esac fi if [ $x -ge 0 ]; then case $x in ???? ) nextRotation="${normal}";; ????? ) nextRotation="${left}";; esac fi if [ ${nextRotation} = ${normal} ]; then case $y in -????? ) nextRotation="${inverted}";; esac fi #re-orientation if [ ${nextRotation} != ${currentOrientation} ]; then xrandr -o ${nextRotation} for input in ${xinputs[@]}; do case ${nextRotation}} in ${normal} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_normal} ;; ${left} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_left} ;; ${inverted} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_inverte};; ${right} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_right} ;; * ) echo "Bug." ;; esac done fi fi sleep ${period} done
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

Guygoye Membre non connecté
-
- Voir le profil du membre Guygoye
- Inscrit le : 25/10/2018
- Groupes :
-
Modérateur
-
Forgeron

Code BASH :
+ xinput ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)] + '[' 0 -ne 0 ']' + xrandr Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767 DSI1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 223mm x 125mm 1366x768 60.19*+ 1280x720 59.74 1152x768 68.35 1024x768 98.16 74.81 60.00 60.00 1024x576 60.00 59.90 59.82 832x624 74.18 960x540 60.00 59.63 59.82 800x600 186.01 94.87 60.32 56.25 768x576 99.99 79.37 864x486 60.00 59.92 59.57 640x480 116.65 59.94 720x405 59.51 60.00 58.99 680x384 60.00 640x360 59.84 59.32 60.00 DP1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) VIRTUAL1 disconnected (normal left inverted right x axis y axis) + '[' 0 -ne 0 ']' + grep -a ./rotate-2.sh /proc/sched_debug + '[' 1 -eq 0 ']' + T_Matrix_normal=' 1 0 0 0 1 0 0 0 1' + T_Matrix_left=' 0 -1 1 1 0 0 0 0 1' + T_Matrix_inverte='-1 0 1 0 -1 1 0 0 1' + T_Matrix_right=' 0 1 0 -1 0 1 0 0 1' + sNormal=normal + sLeft=left + sRight=right + sInverted=interved + vNormal=0 + vLeft=1 + vRight=3 + vInverted=2 + normal=normal + left=left + right=right + inverted=interved + device1='Virtual core XTEST pointer' + device2='Asus TouchPad' + device3='SIS0817:00 0457:1071' + screen=DSI1 + period=1 ++ xinput list + pointers='⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)]' + xinputs= ++ grep '${device1}' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/g' ++ echo ⎡ Virtual core pointer id=2 '[master' pointer '(3)]' ⎜ ↳ Virtual core XTEST pointer id=4 '[slave' pointer '(2)]' ⎜ ↳ Asus TouchPad id=11 '[slave' pointer '(2)]' ⎜ ↳ SIS0817:00 0457:1071 id=13 '[slave' pointer '(2)]' ⎣ Virtual core keyboard id=3 '[master' keyboard '(2)]' ↳ Virtual core XTEST keyboard id=5 '[slave' keyboard '(3)]' ↳ Asus Wireless Radio Control id=6 '[slave' keyboard '(3)]' ↳ Video Bus id=7 '[slave' keyboard '(3)]' ↳ Sleep Button id=8 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=9 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=10 '[slave' keyboard '(3)]' ↳ bytcr-rt5640 Headset id=12 '[slave' keyboard '(3)]' ↳ Asus WMI hotkeys id=14 '[slave' keyboard '(3)]' ↳ gpio-keys id=15 '[slave' keyboard '(3)]' + xinputs=' ' ++ grep '${device2}' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/g' ++ echo ⎡ Virtual core pointer id=2 '[master' pointer '(3)]' ⎜ ↳ Virtual core XTEST pointer id=4 '[slave' pointer '(2)]' ⎜ ↳ Asus TouchPad id=11 '[slave' pointer '(2)]' ⎜ ↳ SIS0817:00 0457:1071 id=13 '[slave' pointer '(2)]' ⎣ Virtual core keyboard id=3 '[master' keyboard '(2)]' ↳ Virtual core XTEST keyboard id=5 '[slave' keyboard '(3)]' ↳ Asus Wireless Radio Control id=6 '[slave' keyboard '(3)]' ↳ Video Bus id=7 '[slave' keyboard '(3)]' ↳ Sleep Button id=8 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=9 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=10 '[slave' keyboard '(3)]' ↳ bytcr-rt5640 Headset id=12 '[slave' keyboard '(3)]' ↳ Asus WMI hotkeys id=14 '[slave' keyboard '(3)]' ↳ gpio-keys id=15 '[slave' keyboard '(3)]' + xinputs=' ' ++ grep '${device3}' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/g' ++ echo ⎡ Virtual core pointer id=2 '[master' pointer '(3)]' ⎜ ↳ Virtual core XTEST pointer id=4 '[slave' pointer '(2)]' ⎜ ↳ Asus TouchPad id=11 '[slave' pointer '(2)]' ⎜ ↳ SIS0817:00 0457:1071 id=13 '[slave' pointer '(2)]' ⎣ Virtual core keyboard id=3 '[master' keyboard '(2)]' ↳ Virtual core XTEST keyboard id=5 '[slave' keyboard '(3)]' ↳ Asus Wireless Radio Control id=6 '[slave' keyboard '(3)]' ↳ Video Bus id=7 '[slave' keyboard '(3)]' ↳ Sleep Button id=8 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=9 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=10 '[slave' keyboard '(3)]' ↳ bytcr-rt5640 Headset id=12 '[slave' keyboard '(3)]' ↳ Asus WMI hotkeys id=14 '[slave' keyboard '(3)]' ↳ gpio-keys id=15 '[slave' keyboard '(3)]' + xinputs=' ' + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=-809 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=14918 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-6200 + nextRotation=normal + '[' -809 -le 0 ']' + case $x in + '[' -809 -ge 0 ']' + '[' normal = normal ']' + case $y in + '[' normal '!=' normal ']' + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=-16193 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=-3009 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-1894 + nextRotation=normal + '[' -16193 -le 0 ']' + case $x in + nextRotation=right + '[' -16193 -ge 0 ']' + '[' right = normal ']' + '[' right '!=' normal ']' + xrandr -o right + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=right + case ${currentOrientation} in + currentOrientation=right ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=-8490 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=14436 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-336 + nextRotation=normal + '[' -8490 -le 0 ']' + case $x in + nextRotation=normal + '[' -8490 -ge 0 ']' + '[' normal = normal ']' + case $y in + '[' normal '!=' right ']' + xrandr -o normal + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
+ xinputs=' '
Laisse moi retravailler ça.
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Code BASH :
#!/bin/bash -x # Review 2019-04-19 by Jean-Baptiste Biernacki ## Review 2016-01-03 by John Wells ## https://github.com/jfwells/linux-asus-t100ta/blob/master/support-scripts/rotate.sh ### Based 2010-10-26 on an original by Maxwell Pray (synthead), from ### https://bbs.archlinux.org/viewtopic.php?id=107167 #For information : #xinput list #⎡ Virtual core pointer id=2 [master pointer (3)] #⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] #⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] #⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] #⎣ Virtual core keyboard id=3 [master keyboard (2)] # ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] # ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] # ↳ Video Bus id=7 [slave keyboard (3)] # ↳ Sleep Button id=8 [slave keyboard (3)] # ↳ Asus Keyboard id=9 [slave keyboard (3)] # ↳ Asus Keyboard id=10 [slave keyboard (3)] # ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] # ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] # ↳ gpio-keys id=15 [slave keyboard (3)] #Check dependencies : xinput if [ ${?} -ne 0 ]; then echo "Install xinput first." exit fi xrandr if [ ${?} -ne 0 ]; then echo "Install xrandr first." exit fi grep -a $0 /proc/sched_debug 2>/dev/null if [ ${?} -eq 0 ]; then echo "The script is already running!" exit fi #Normal transformation matrix # 1 0 0 # 0 1 0 # 0 0 1 T_Matrix_normal=" 1 0 0 0 1 0 0 0 1" #Left transformation matrix # 0 -1 1 # 1 0 0 # 0 0 1 T_Matrix_left=" 0 -1 1 1 0 0 0 0 1" #Inverted transformation matrix #-1 0 1 # 0 -1 1 # 0 0 1 T_Matrix_inverte="-1 0 1 0 -1 1 0 0 1" #Right transformation matrix # 0 1 0 #-1 0 1 # 0 0 1 T_Matrix_right=" 0 1 0 -1 0 1 0 0 1" #variables sNormal="normal" sLeft="left" sRight="right" sInverted="interved" vNormal=0 vLeft=1 vRight=3 vInverted=2 #Change s[[:alpha:]] to v[[:alpha:]] for switching from string to value : normal=${sNormal} left=${sLeft} right=${sRight} inverted=${sInverted} #List of input devices to rotate : #For the full available list, type : $ xinput list device1="Virtual core XTEST pointer" device2="Asus TouchPad" device3="SIS0817:00 0457:1071" #device4="bytcr-rt5640 Headset" #device5="" #The screen to rotate : #To know which screen is to rotate, type : $ xrandr | grep " connected" | sed "s/^\([[:alnum:]]*\)[[:space:]].*/\1/" screen="DSI1" #Time between two loops period=1 pointers="$(xinput list)" xinputs="" xinputs="${xinputs} $(echo ${pointers} | grep \"${device1}\" | sed 's/.*id=\([[:digit:]]*\).*/\1/g')" xinputs="${xinputs} $(echo ${pointers} | grep \"${device2}\" | sed 's/.*id=\([[:digit:]]*\).*/\1/g')" xinputs="${xinputs} $(echo ${pointers} | grep \"${device3}\" | sed 's/.*id=\([[:digit:]]*\).*/\1/g')" #xinputs="${xinputs} $(echo ${pointers} | grep \"${device4}\" | sed 's/.*id=\([[:digit:]]*\).*/\1/g')" #Set default setting for locked orientation: #Not implemented. #lockFile="/tmp/lockedOrientation" #echo "0" > ${lockFile} while true; do #Check if rotation is locked. #Not implemented. locked=0 #locked=$(cat ${lockFile}) if [ ${locked} -eq 0 ]; then #Get current orientation set currentOrientation=$(xrandr --verbose | grep ${screen} | sed -e "s/.*) \([[:alpha:]]*\) (.*/\1/") case ${currentOrientation} in ${sNormal} ) currentOrientation="${normal}" ;; ${sLeft} ) currentOrientation="${left}" ;; ${sInverted} ) currentOrientation="${inverted}";; ${sRight} ) currentOrientation="${right}" ;; * ) echo "bug.";; esac #Get data from accelerometer x=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_x_raw) y=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_y_raw) z=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw) nextRotation="${normal}" if [ $x -le 0 ]; then case $x in -???? ) nextRotation="${normal}";; -????? ) nextRotation="${right}";; esac fi if [ $x -ge 0 ]; then case $x in ???? ) nextRotation="${normal}";; ????? ) nextRotation="${left}";; esac fi if [ ${nextRotation} = ${normal} ]; then case $y in -????? ) nextRotation="${inverted}";; esac fi #re-orientation if [ ${nextRotation} != ${currentOrientation} ]; then xrandr -o ${nextRotation} for input in ${xinputs[@]}; do case ${nextRotation}} in ${normal} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_normal} ;; ${left} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_left} ;; ${inverted} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_inverte};; ${right} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_right} ;; * ) echo "Bug." ;; esac done fi fi sleep ${period} done
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

Guygoye Membre non connecté
-
- Voir le profil du membre Guygoye
- Inscrit le : 25/10/2018
- Groupes :
-
Modérateur
-
Forgeron
Code BASH :
+ xinput ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)] + '[' 0 -ne 0 ']' + xrandr Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767 DSI1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 223mm x 125mm 1366x768 60.19*+ 1280x720 59.74 1152x768 68.35 1024x768 98.16 74.81 60.00 60.00 1024x576 60.00 59.90 59.82 832x624 74.18 960x540 60.00 59.63 59.82 800x600 186.01 94.87 60.32 56.25 768x576 99.99 79.37 864x486 60.00 59.92 59.57 640x480 116.65 59.94 720x405 59.51 60.00 58.99 680x384 60.00 640x360 59.84 59.32 60.00 DP1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) VIRTUAL1 disconnected (normal left inverted right x axis y axis) + '[' 0 -ne 0 ']' + grep -a ./rotate-2.sh /proc/sched_debug + '[' 1 -eq 0 ']' + T_Matrix_normal=' 1 0 0 0 1 0 0 0 1' + T_Matrix_left=' 0 -1 1 1 0 0 0 0 1' + T_Matrix_inverte='-1 0 1 0 -1 1 0 0 1' + T_Matrix_right=' 0 1 0 -1 0 1 0 0 1' + sNormal=normal + sLeft=left + sRight=right + sInverted=interved + vNormal=0 + vLeft=1 + vRight=3 + vInverted=2 + normal=normal + left=left + right=right + inverted=interved + device1='Virtual core XTEST pointer' + device2='Asus TouchPad' + device3='SIS0817:00 0457:1071' + screen=DSI1 + period=1 ++ xinput list + pointers='⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)]' + xinputs= ++ grep '"Virtual' core XTEST 'pointer"' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/g' ++ echo ⎡ Virtual core pointer id=2 '[master' pointer '(3)]' ⎜ ↳ Virtual core XTEST pointer id=4 '[slave' pointer '(2)]' ⎜ ↳ Asus TouchPad id=11 '[slave' pointer '(2)]' ⎜ ↳ SIS0817:00 0457:1071 id=13 '[slave' pointer '(2)]' ⎣ Virtual core keyboard id=3 '[master' keyboard '(2)]' ↳ Virtual core XTEST keyboard id=5 '[slave' keyboard '(3)]' ↳ Asus Wireless Radio Control id=6 '[slave' keyboard '(3)]' ↳ Video Bus id=7 '[slave' keyboard '(3)]' ↳ Sleep Button id=8 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=9 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=10 '[slave' keyboard '(3)]' ↳ bytcr-rt5640 Headset id=12 '[slave' keyboard '(3)]' ↳ Asus WMI hotkeys id=14 '[slave' keyboard '(3)]' ↳ gpio-keys id=15 '[slave' keyboard '(3)]' grep: core: Aucun fichier ou dossier de ce type grep: XTEST: Aucun fichier ou dossier de ce type grep: pointer": Aucun fichier ou dossier de ce type + xinputs=' ' ++ grep '"Asus' 'TouchPad"' ++ echo ⎡ Virtual core pointer id=2 '[master' pointer '(3)]' ⎜ ↳ Virtual core XTEST pointer id=4 '[slave' pointer '(2)]' ⎜ ↳ Asus TouchPad id=11 '[slave' pointer '(2)]' ⎜ ↳ SIS0817:00 0457:1071 id=13 '[slave' pointer '(2)]' ⎣ Virtual core keyboard id=3 '[master' keyboard '(2)]' ↳ Virtual core XTEST keyboard id=5 '[slave' keyboard '(3)]' ↳ Asus Wireless Radio Control id=6 '[slave' keyboard '(3)]' ↳ Video Bus id=7 '[slave' keyboard '(3)]' ↳ Sleep Button id=8 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=9 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=10 '[slave' keyboard '(3)]' ↳ bytcr-rt5640 Headset id=12 '[slave' keyboard '(3)]' ↳ Asus WMI hotkeys id=14 '[slave' keyboard '(3)]' ↳ gpio-keys id=15 '[slave' keyboard '(3)]' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/g' grep: TouchPad": Aucun fichier ou dossier de ce type + xinputs=' ' ++ grep '"SIS0817:00' '0457:1071"' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/g' ++ echo ⎡ Virtual core pointer id=2 '[master' pointer '(3)]' ⎜ ↳ Virtual core XTEST pointer id=4 '[slave' pointer '(2)]' ⎜ ↳ Asus TouchPad id=11 '[slave' pointer '(2)]' ⎜ ↳ SIS0817:00 0457:1071 id=13 '[slave' pointer '(2)]' ⎣ Virtual core keyboard id=3 '[master' keyboard '(2)]' ↳ Virtual core XTEST keyboard id=5 '[slave' keyboard '(3)]' ↳ Asus Wireless Radio Control id=6 '[slave' keyboard '(3)]' ↳ Video Bus id=7 '[slave' keyboard '(3)]' ↳ Sleep Button id=8 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=9 '[slave' keyboard '(3)]' ↳ Asus Keyboard id=10 '[slave' keyboard '(3)]' ↳ bytcr-rt5640 Headset id=12 '[slave' keyboard '(3)]' ↳ Asus WMI hotkeys id=14 '[slave' keyboard '(3)]' ↳ gpio-keys id=15 '[slave' keyboard '(3)]' grep: 0457:1071": Aucun fichier ou dossier de ce type + xinputs=' ' + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' ++ grep DSI1 + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=1218 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=13832 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-8709 + nextRotation=normal + '[' 1218 -le 0 ']' + '[' 1218 -ge 0 ']' + case $x in + nextRotation=normal + '[' normal = normal ']' + case $y in + '[' normal '!=' normal ']' + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=17243 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=298 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-1845 + nextRotation=normal + '[' 17243 -le 0 ']' + '[' 17243 -ge 0 ']' + case $x in + nextRotation=left + '[' left = normal ']' + '[' left '!=' normal ']' + xrandr -o left + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=left + case ${currentOrientation} in + currentOrientation=left ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=8930 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=12494 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-2085 + nextRotation=normal + '[' 8930 -le 0 ']' + '[' 8930 -ge 0 ']' + case $x in + nextRotation=normal + '[' normal = normal ']' + case $y in + '[' normal '!=' left ']' + xrandr -o normal + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=-193 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=13104 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-9616 + nextRotation=normal + '[' -193 -le 0 ']' + case $x in + '[' -193 -ge 0 ']' + '[' normal = normal ']' + case $y in + '[' normal '!=' normal ']' + sleep 1 z+ true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=504 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=13029 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-10184 + nextRotation=normal + '[' 504 -le 0 ']' + '[' 504 -ge 0 ']' + case $x in + '[' normal = normal ']' + case $y in + '[' normal '!=' normal ']' + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=-890 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=13332 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-9537 + nextRotation=normal + '[' -890 -le 0 ']' + case $x in + '[' -890 -ge 0 ']' + '[' normal = normal ']' + case $y in + '[' normal '!=' normal ']' + sleep 1

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Code BASH :
#!/bin/bash -x # Review 2019-04-19 by Jean-Baptiste Biernacki ## Review 2016-01-03 by John Wells ## https://github.com/jfwells/linux-asus-t100ta/blob/master/support-scripts/rotate.sh ### Based 2010-10-26 on an original by Maxwell Pray (synthead), from ### https://bbs.archlinux.org/viewtopic.php?id=107167 #For information : #xinput list #⎡ Virtual core pointer id=2 [master pointer (3)] #⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] #⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] #⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] #⎣ Virtual core keyboard id=3 [master keyboard (2)] # ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] # ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] # ↳ Video Bus id=7 [slave keyboard (3)] # ↳ Sleep Button id=8 [slave keyboard (3)] # ↳ Asus Keyboard id=9 [slave keyboard (3)] # ↳ Asus Keyboard id=10 [slave keyboard (3)] # ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] # ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] # ↳ gpio-keys id=15 [slave keyboard (3)] #Check dependencies : xinput if [ ${?} -ne 0 ]; then echo "Install xinput first." exit fi xrandr if [ ${?} -ne 0 ]; then echo "Install xrandr first." exit fi grep -a $0 /proc/sched_debug 2>/dev/null if [ ${?} -eq 0 ]; then echo "The script is already running!" exit fi #Normal transformation matrix # 1 0 0 # 0 1 0 # 0 0 1 T_Matrix_normal=" 1 0 0 0 1 0 0 0 1" #Left transformation matrix # 0 -1 1 # 1 0 0 # 0 0 1 T_Matrix_left=" 0 -1 1 1 0 0 0 0 1" #Inverted transformation matrix #-1 0 1 # 0 -1 1 # 0 0 1 T_Matrix_inverte="-1 0 1 0 -1 1 0 0 1" #Right transformation matrix # 0 1 0 #-1 0 1 # 0 0 1 T_Matrix_right=" 0 1 0 -1 0 1 0 0 1" #variables sNormal="normal" sLeft="left" sRight="right" sInverted="interved" vNormal=0 vLeft=1 vRight=3 vInverted=2 #Change s[[:alpha:]] to v[[:alpha:]] for switching from string to value : normal=${sNormal} left=${sLeft} right=${sRight} inverted=${sInverted} #List of input devices to rotate : #For the full available list, type : $ xinput list device1="Virtual core XTEST pointer" device2="Asus TouchPad" device3="SIS0817:00 0457:1071" #device4="bytcr-rt5640 Headset" #device5="" #The screen to rotate : #To know which screen is to rotate, type : $ xrandr | grep " connected" | sed "s/^\([[:alnum:]]*\)[[:space:]].*/\1/" screen="DSI1" #Time between two loops period=1 pointers="$(xinput list)" xinputs="" xinputs="${xinputs} $(echo "${pointers}" | grep "${device1}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" xinputs="${xinputs} $(echo "${pointers}" | grep "${device2}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" xinputs="${xinputs} $(echo "${pointers}" | grep "${device3}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" #xinputs="${xinputs} $(echo ${pointers} | grep "${device4}" | sed 's/.*id=\([[:digit:]]*\).*/\1/g' | tr '\n' ' ')" #Set default setting for locked orientation: #Not implemented. #lockFile="/tmp/lockedOrientation" #echo "0" > ${lockFile} while true; do #Check if rotation is locked. #Not implemented. locked=0 #locked=$(cat ${lockFile}) if [ ${locked} -eq 0 ]; then #Get current orientation set currentOrientation=$(xrandr --verbose | grep ${screen} | sed -e "s/.*) \([[:alpha:]]*\) (.*/\1/") case ${currentOrientation} in ${sNormal} ) currentOrientation="${normal}" ;; ${sLeft} ) currentOrientation="${left}" ;; ${sInverted} ) currentOrientation="${inverted}";; ${sRight} ) currentOrientation="${right}" ;; * ) echo "bug.";; esac #Get data from accelerometer x=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_x_raw) y=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_y_raw) z=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw) nextRotation="${normal}" if [ $x -le 0 ]; then case $x in -???? ) nextRotation="${normal}";; -????? ) nextRotation="${right}";; esac fi if [ $x -ge 0 ]; then case $x in ???? ) nextRotation="${normal}";; ????? ) nextRotation="${left}";; esac fi if [ ${nextRotation} = ${normal} ]; then case $y in -????? ) nextRotation="${inverted}";; esac fi #re-orientation if [ ${nextRotation} != ${currentOrientation} ]; then xrandr -o ${nextRotation} for input in ${xinputs[@]}; do case ${nextRotation}} in ${normal} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_normal} ;; ${left} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_left} ;; ${inverted} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_inverte};; ${right} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_right} ;; * ) echo "Bug." ;; esac done fi fi sleep ${period} done
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

Guygoye Membre non connecté
-
- Voir le profil du membre Guygoye
- Inscrit le : 25/10/2018
- Groupes :
-
Modérateur
-
Forgeron
Code BASH :
⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)] Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767 DSI1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 223mm x 125mm 1366x768 60.19*+ 1280x720 59.74 1152x768 68.35 1024x768 98.16 74.81 60.00 60.00 1024x576 60.00 59.90 59.82 832x624 74.18 960x540 60.00 59.63 59.82 800x600 186.01 94.87 60.32 56.25 768x576 99.99 79.37 864x486 60.00 59.92 59.57 640x480 116.65 59.94 720x405 59.51 60.00 58.99 680x384 60.00 640x360 59.84 59.32 60.00 DP1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) VIRTUAL1 disconnected (normal left inverted right x axis y axis) Bug. Bug. Bug. Bug. Bug. Bug.

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Code BASH :
#!/bin/bash -x # Review 2019-04-19 by Jean-Baptiste Biernacki ## Review 2016-01-03 by John Wells ## https://github.com/jfwells/linux-asus-t100ta/blob/master/support-scripts/rotate.sh ### Based 2010-10-26 on an original by Maxwell Pray (synthead), from ### https://bbs.archlinux.org/viewtopic.php?id=107167 #For information : #xinput list #⎡ Virtual core pointer id=2 [master pointer (3)] #⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] #⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] #⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] #⎣ Virtual core keyboard id=3 [master keyboard (2)] # ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] # ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] # ↳ Video Bus id=7 [slave keyboard (3)] # ↳ Sleep Button id=8 [slave keyboard (3)] # ↳ Asus Keyboard id=9 [slave keyboard (3)] # ↳ Asus Keyboard id=10 [slave keyboard (3)] # ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] # ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] # ↳ gpio-keys id=15 [slave keyboard (3)] #Check dependencies : hash xinput 2>/dev/null if [ ${?} -ne 0 ]; then echo "Install xinput first." exit fi hash xrandr 2>/dev/null if [ ${?} -ne 0 ]; then echo "Install xrandr first." exit fi grep -a $0 /proc/sched_debug 2>/dev/null if [ ${?} -eq 0 ]; then echo "The script is already running!" exit fi #Normal transformation matrix # 1 0 0 # 0 1 0 # 0 0 1 T_Matrix_normal=" 1 0 0 0 1 0 0 0 1" #Left transformation matrix # 0 -1 1 # 1 0 0 # 0 0 1 T_Matrix_left=" 0 -1 1 1 0 0 0 0 1" #Inverted transformation matrix #-1 0 1 # 0 -1 1 # 0 0 1 T_Matrix_inverte="-1 0 1 0 -1 1 0 0 1" #Right transformation matrix # 0 1 0 #-1 0 1 # 0 0 1 T_Matrix_right=" 0 1 0 -1 0 1 0 0 1" #variables sNormal="normal" sLeft="left" sRight="right" sInverted="interved" vNormal=0 vLeft=1 vRight=3 vInverted=2 #Change s[[:alpha:]] to v[[:alpha:]] for switching from string to value : normal=${sNormal} left=${sLeft} right=${sRight} inverted=${sInverted} #List of input devices to rotate : #For the full available list, type : $ xinput list device1="Virtual core XTEST pointer" device2="Asus TouchPad" device3="SIS0817:00 0457:1071" #device4="bytcr-rt5640 Headset" #device5="" #The screen to rotate : #To know which screen is to rotate, type : $ xrandr | grep " connected" | sed "s/^\([[:alnum:]]*\)[[:space:]].*/\1/" screen="DSI1" #Time between two loops period=1 pointers="$(xinput list)" xinputs="" xinputs="${xinputs} $(echo "${pointers}" | grep "${device1}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" xinputs="${xinputs} $(echo "${pointers}" | grep "${device2}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" xinputs="${xinputs} $(echo "${pointers}" | grep "${device3}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" #xinputs="${xinputs} $(echo ${pointers} | grep "${device4}" | sed 's/.*id=\([[:digit:]]*\).*/\1/g' | tr '\n' ' ')" #Set default setting for locked orientation: #Not implemented. #lockFile="/tmp/lockedOrientation" #echo "0" > ${lockFile} while true; do #Check if rotation is locked. #Not implemented. locked=0 #locked=$(cat ${lockFile}) if [ ${locked} -eq 0 ]; then #Get current orientation set currentOrientation=$(xrandr --verbose | grep ${screen} | sed -e "s/.*) \([[:alpha:]]*\) (.*/\1/") case ${currentOrientation} in ${sNormal} ) currentOrientation="${normal}" ;; ${sLeft} ) currentOrientation="${left}" ;; ${sInverted} ) currentOrientation="${inverted}";; ${sRight} ) currentOrientation="${right}" ;; * ) echo "bug.";; esac #Get data from accelerometer x=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_x_raw) y=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_y_raw) z=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw) nextRotation="${normal}" if [ $x -le 0 ]; then case $x in -???? ) nextRotation="${normal}";; -????? ) nextRotation="${right}";; esac fi if [ $x -ge 0 ]; then case $x in ???? ) nextRotation="${normal}";; ????? ) nextRotation="${left}";; esac fi if [ ${nextRotation} = ${normal} ]; then case $y in -????? ) nextRotation="${inverted}";; esac fi #re-orientation if [ ${nextRotation} != ${currentOrientation} ]; then xrandr -o ${nextRotation} for input in ${xinputs[@]}; do case ${nextRotation}} in ${normal} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_normal} ;; ${left} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_left} ;; ${inverted} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_inverte};; ${right} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_right} ;; * ) echo "Bug." ;; esac done fi fi sleep ${period} done
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

Guygoye Membre non connecté
-
- Voir le profil du membre Guygoye
- Inscrit le : 25/10/2018
- Groupes :
-
Modérateur
-
Forgeron

Guygoye Membre non connecté
-
- Voir le profil du membre Guygoye
- Inscrit le : 25/10/2018
- Groupes :
-
Modérateur
-
Forgeron
Code BASH :
+ hash xinput + '[' 0 -ne 0 ']' + hash xrandr + '[' 0 -ne 0 ']' + grep -a ./rotate-2.sh /proc/sched_debug + '[' 1 -eq 0 ']' + T_Matrix_normal=' 1 0 0 0 1 0 0 0 1' + T_Matrix_left=' 0 -1 1 1 0 0 0 0 1' + T_Matrix_inverte='-1 0 1 0 -1 1 0 0 1' + T_Matrix_right=' 0 1 0 -1 0 1 0 0 1' + sNormal=normal + sLeft=left + sRight=right + sInverted=interved + vNormal=0 + vLeft=1 + vRight=3 + vInverted=2 + normal=normal + left=left + right=right + inverted=interved + device1='Virtual core XTEST pointer' + device2='Asus TouchPad' + device3='SIS0817:00 0457:1071' + screen=DSI1 + period=1 ++ xinput list + pointers='⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)]' + xinputs= ++ echo '⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)]' ++ grep 'Virtual core XTEST pointer' ++ tr '\n' ' ' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/' + xinputs=' 4 ' ++ grep 'Asus TouchPad' ++ echo '⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)]' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/' ++ tr '\n' ' ' + xinputs=' 4 11 ' ++ grep 'SIS0817:00 0457:1071' ++ echo '⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)]' ++ tr '\n' ' ' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/' + xinputs=' 4 11 13 ' + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=-613 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=14471 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-7595 + nextRotation=normal + '[' -613 -le 0 ']' + case $x in + '[' -613 -ge 0 ']' + '[' normal = normal ']' + case $y in + '[' normal '!=' normal ']' + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=-487 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=13835 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-8491 + nextRotation=normal + '[' -487 -le 0 ']' + case $x in + '[' -487 -ge 0 ']' + '[' normal = normal ']' + case $y in + '[' normal '!=' normal ']' + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=13845 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=3097 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-4003 + nextRotation=normal + '[' 13845 -le 0 ']' + '[' 13845 -ge 0 ']' + case $x in + nextRotation=left + '[' left = normal ']' + '[' left '!=' normal ']' + xrandr -o left + for input in ${xinputs[@]} + case ${nextRotation}} in + echo Bug. Bug. + for input in ${xinputs[@]} + case ${nextRotation}} in + echo Bug. Bug. + for input in ${xinputs[@]} + case ${nextRotation}} in + echo Bug. Bug. + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=left + case ${currentOrientation} in + currentOrientation=left ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=15850 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=979 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-4514 + nextRotation=normal + '[' 15850 -le 0 ']' + '[' 15850 -ge 0 ']' + case $x in + nextRotation=left + '[' left = normal ']' + '[' left '!=' left ']' + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=left + case ${currentOrientation} in + currentOrientation=left ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=12932 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=11481 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-5017 + nextRotation=normal + '[' 12932 -le 0 ']' + '[' 12932 -ge 0 ']' + case $x in + nextRotation=left + '[' left = normal ']' + '[' left '!=' left ']' + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=left + case ${currentOrientation} in + currentOrientation=left ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=-407 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=14603 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-8022 + nextRotation=normal + '[' -407 -le 0 ']' + case $x in + '[' -407 -ge 0 ']' + '[' normal = normal ']' + case $y in + '[' normal '!=' left ']' + xrandr -o normal

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Code BASH :
#!/bin/bash -x # Review 2019-04-19 by Jean-Baptiste Biernacki ## Review 2016-01-03 by John Wells ## https://github.com/jfwells/linux-asus-t100ta/blob/master/support-scripts/rotate.sh ### Based 2010-10-26 on an original by Maxwell Pray (synthead), from ### https://bbs.archlinux.org/viewtopic.php?id=107167 #For information : #xinput list #⎡ Virtual core pointer id=2 [master pointer (3)] #⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] #⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] #⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] #⎣ Virtual core keyboard id=3 [master keyboard (2)] # ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] # ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] # ↳ Video Bus id=7 [slave keyboard (3)] # ↳ Sleep Button id=8 [slave keyboard (3)] # ↳ Asus Keyboard id=9 [slave keyboard (3)] # ↳ Asus Keyboard id=10 [slave keyboard (3)] # ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] # ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] # ↳ gpio-keys id=15 [slave keyboard (3)] #Check dependencies : hash xinput 2>/dev/null if [ ${?} -ne 0 ]; then echo "Install xinput first." exit fi hash xrandr 2>/dev/null if [ ${?} -ne 0 ]; then echo "Install xrandr first." exit fi grep -a $0 /proc/sched_debug 2>/dev/null if [ ${?} -eq 0 ]; then echo "The script is already running!" exit fi #Normal transformation matrix # 1 0 0 # 0 1 0 # 0 0 1 T_Matrix_normal=" 1 0 0 0 1 0 0 0 1" #Left transformation matrix # 0 -1 1 # 1 0 0 # 0 0 1 T_Matrix_left=" 0 -1 1 1 0 0 0 0 1" #Inverted transformation matrix #-1 0 1 # 0 -1 1 # 0 0 1 T_Matrix_inverte="-1 0 1 0 -1 1 0 0 1" #Right transformation matrix # 0 1 0 #-1 0 1 # 0 0 1 T_Matrix_right=" 0 1 0 -1 0 1 0 0 1" #variables sNormal="normal" sLeft="left" sRight="right" sInverted="interved" vNormal=0 vLeft=1 vRight=3 vInverted=2 #Change s[[:alpha:]] to v[[:alpha:]] for switching from string to value : normal=${sNormal} left=${sLeft} right=${sRight} inverted=${sInverted} #List of input devices to rotate : #For the full available list, type : $ xinput list device1="Virtual core XTEST pointer" device2="Asus TouchPad" device3="SIS0817:00 0457:1071" #device4="bytcr-rt5640 Headset" #device5="" #The screen to rotate : #To know which screen is to rotate, type : $ xrandr | grep " connected" | sed "s/^\([[:alnum:]]*\)[[:space:]].*/\1/" screen="DSI1" #Time between two loops period=1 pointers="$(xinput list)" xinputs="" xinputs="${xinputs} $(echo "${pointers}" | grep "${device1}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" xinputs="${xinputs} $(echo "${pointers}" | grep "${device2}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" xinputs="${xinputs} $(echo "${pointers}" | grep "${device3}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" #xinputs="${xinputs} $(echo ${pointers} | grep "${device4}" | sed 's/.*id=\([[:digit:]]*\).*/\1/g' | tr '\n' ' ')" #Set default setting for locked orientation: #Not implemented. #lockFile="/tmp/lockedOrientation" #echo "0" > ${lockFile} while true; do #Check if rotation is locked. #Not implemented. locked=0 #locked=$(cat ${lockFile}) if [ ${locked} -eq 0 ]; then #Get current orientation set currentOrientation=$(xrandr --verbose | grep ${screen} | sed -e "s/.*) \([[:alpha:]]*\) (.*/\1/") case ${currentOrientation} in ${sNormal} ) currentOrientation="${normal}" ;; ${sLeft} ) currentOrientation="${left}" ;; ${sInverted} ) currentOrientation="${inverted}";; ${sRight} ) currentOrientation="${right}" ;; * ) echo "bug.";; esac #Get data from accelerometer x=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_x_raw) y=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_y_raw) z=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw) nextRotation="${normal}" if [ $x -le 0 ]; then case $x in -???? ) nextRotation="${normal}";; -????? ) nextRotation="${right}";; esac fi if [ $x -ge 0 ]; then case $x in ???? ) nextRotation="${normal}";; ????? ) nextRotation="${left}";; esac fi if [ ${nextRotation} = ${normal} ]; then case $y in -????? ) nextRotation="${inverted}";; esac fi #re-orientation if [ ${nextRotation} != ${currentOrientation} ]; then xrandr -o ${nextRotation} for input in ${xinputs[@]}; do case ${nextRotation}} in ${normal} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_normal} ;; ${left} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_left} ;; ${inverted} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_inverte};; ${right} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_right} ;; * ) echo "Bug. input=${input}, nextRotation=${nextRotation}" ;; esac done fi fi sleep ${period} done
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

Guygoye Membre non connecté
-
- Voir le profil du membre Guygoye
- Inscrit le : 25/10/2018
- Groupes :
-
Modérateur
-
Forgeron

Je te laisse dans le suspens

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Guygoye :
Bon je teste ça demain 
Je te laisse dans le suspens

Je te laisse dans le suspens

Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

Guygoye Membre non connecté
-
- Voir le profil du membre Guygoye
- Inscrit le : 25/10/2018
- Groupes :
-
Modérateur
-
Forgeron
Code BASH :
+ hash xinput + '[' 0 -ne 0 ']' + hash xrandr + '[' 0 -ne 0 ']' + grep -a ./rotate-2.sh /proc/sched_debug + '[' 1 -eq 0 ']' + T_Matrix_normal=' 1 0 0 0 1 0 0 0 1' + T_Matrix_left=' 0 -1 1 1 0 0 0 0 1' + T_Matrix_inverte='-1 0 1 0 -1 1 0 0 1' + T_Matrix_right=' 0 1 0 -1 0 1 0 0 1' + sNormal=normal + sLeft=left + sRight=right + sInverted=interved + vNormal=0 + vLeft=1 + vRight=3 + vInverted=2 + normal=normal + left=left + right=right + inverted=interved + device1='Virtual core XTEST pointer' + device2='Asus TouchPad' + device3='SIS0817:00 0457:1071' + screen=DSI1 + period=1 ++ xinput list + pointers='⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)]' + xinputs= ++ sed 's/.*id=\([[:digit:]]*\).*/\1/' ++ tr '\n' ' ' ++ grep 'Virtual core XTEST pointer' ++ echo '⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)]' + xinputs=' 4 ' ++ echo '⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)]' ++ grep 'Asus TouchPad' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/' ++ tr '\n' ' ' + xinputs=' 4 11 ' ++ grep 'SIS0817:00 0457:1071' ++ echo '⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] ⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ Asus Keyboard id=9 [slave keyboard (3)] ↳ Asus Keyboard id=10 [slave keyboard (3)] ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] ↳ gpio-keys id=15 [slave keyboard (3)]' ++ tr '\n' ' ' ++ sed 's/.*id=\([[:digit:]]*\).*/\1/' + xinputs=' 4 11 13 ' + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=-1186 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=13488 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-8936 + nextRotation=normal + '[' -1186 -le 0 ']' + case $x in + nextRotation=normal + '[' -1186 -ge 0 ']' + '[' normal = normal ']' + case $y in + '[' normal '!=' normal ']' + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=normal + case ${currentOrientation} in + currentOrientation=normal ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=16293 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=-2774 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-5092 + nextRotation=normal + '[' 16293 -le 0 ']' + '[' 16293 -ge 0 ']' + case $x in + nextRotation=left + '[' left = normal ']' + '[' left '!=' normal ']' + xrandr -o left + for input in ${xinputs[@]} + case ${nextRotation}} in + echo 'Bug. input=4, nextRotation=left' Bug. input=4, nextRotation=left + for input in ${xinputs[@]} + case ${nextRotation}} in + echo 'Bug. input=11, nextRotation=left' Bug. input=11, nextRotation=left + for input in ${xinputs[@]} + case ${nextRotation}} in + echo 'Bug. input=13, nextRotation=left' Bug. input=13, nextRotation=left + sleep 1 + true + locked=0 + '[' 0 -eq 0 ']' ++ xrandr --verbose ++ grep DSI1 ++ sed -e 's/.*) \([[:alpha:]]*\) (.*/\1/' + currentOrientation=left + case ${currentOrientation} in + currentOrientation=left ++ cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw + x=555 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw + y=15362 ++ cat /sys/bus/iio/devices/iio:device0/in_accel_z_raw + z=-7572 + nextRotation=normal + '[' 555 -le 0 ']' + '[' 555 -ge 0 ']' + case $x in + '[' normal = normal ']' + case $y in + '[' normal '!=' left ']' + xrandr -o normal + for input in ${xinputs[@]} + case ${nextRotation}} in + echo 'Bug. input=4, nextRotation=normal' Bug. input=4, nextRotation=normal + for input in ${xinputs[@]} + case ${nextRotation}} in + echo 'Bug. input=11, nextRotation=normal' Bug. input=11, nextRotation=normal + for input in ${xinputs[@]} + case ${nextRotation}} in + echo 'Bug. input=13, nextRotation=normal' Bug. input=13, nextRotation=normal + sleep 1
Bonne fin de soirée à demain


Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
PS je crois que le script est bon maintenant

Code BASH :
#!/bin/bash -x # Review 2019-04-19 by Jean-Baptiste Biernacki ## Review 2016-01-03 by John Wells ## https://github.com/jfwells/linux-asus-t100ta/blob/master/support-scripts/rotate.sh ### Based 2010-10-26 on an original by Maxwell Pray (synthead), from ### https://bbs.archlinux.org/viewtopic.php?id=107167 #For information : #xinput list #⎡ Virtual core pointer id=2 [master pointer (3)] #⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] #⎜ ↳ Asus TouchPad id=11 [slave pointer (2)] #⎜ ↳ SIS0817:00 0457:1071 id=13 [slave pointer (2)] #⎣ Virtual core keyboard id=3 [master keyboard (2)] # ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] # ↳ Asus Wireless Radio Control id=6 [slave keyboard (3)] # ↳ Video Bus id=7 [slave keyboard (3)] # ↳ Sleep Button id=8 [slave keyboard (3)] # ↳ Asus Keyboard id=9 [slave keyboard (3)] # ↳ Asus Keyboard id=10 [slave keyboard (3)] # ↳ bytcr-rt5640 Headset id=12 [slave keyboard (3)] # ↳ Asus WMI hotkeys id=14 [slave keyboard (3)] # ↳ gpio-keys id=15 [slave keyboard (3)] #Check dependencies : hash xinput 2>/dev/null if [ ${?} -ne 0 ]; then echo "Install xinput first." exit fi hash xrandr 2>/dev/null if [ ${?} -ne 0 ]; then echo "Install xrandr first." exit fi grep -a $0 /proc/sched_debug 2>/dev/null if [ ${?} -eq 0 ]; then echo "The script is already running!" exit fi #Normal transformation matrix # 1 0 0 # 0 1 0 # 0 0 1 T_Matrix_normal=" 1 0 0 0 1 0 0 0 1" #Left transformation matrix # 0 -1 1 # 1 0 0 # 0 0 1 T_Matrix_left=" 0 -1 1 1 0 0 0 0 1" #Inverted transformation matrix #-1 0 1 # 0 -1 1 # 0 0 1 T_Matrix_inverte="-1 0 1 0 -1 1 0 0 1" #Right transformation matrix # 0 1 0 #-1 0 1 # 0 0 1 T_Matrix_right=" 0 1 0 -1 0 1 0 0 1" #variables sNormal="normal" sLeft="left" sRight="right" sInverted="interved" vNormal=0 vLeft=1 vRight=3 vInverted=2 #Change s[[:alpha:]] to v[[:alpha:]] for switching from string to value : normal=${sNormal} left=${sLeft} right=${sRight} inverted=${sInverted} shopt -s extglob #List of input devices to rotate : #For the full available list, type : $ xinput list device1="Virtual core XTEST pointer" device2="Asus TouchPad" device3="SIS0817:00 0457:1071" #device4="bytcr-rt5640 Headset" #device5="" #The screen to rotate : #To know which screen is to rotate, type : $ xrandr | grep " connected" | sed "s/^\([[:alnum:]]*\)[[:space:]].*/\1/" screen="DSI1" #Time between two loops period=1 pointers="$(xinput list)" xinputs="" xinputs="${xinputs} $(echo "${pointers}" | grep "${device1}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" xinputs="${xinputs} $(echo "${pointers}" | grep "${device2}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" xinputs="${xinputs} $(echo "${pointers}" | grep "${device3}" | sed 's/.*id=\([[:digit:]]*\).*/\1/' | tr '\n' ' ')" #xinputs="${xinputs} $(echo ${pointers} | grep "${device4}" | sed 's/.*id=\([[:digit:]]*\).*/\1/g' | tr '\n' ' ')" #Set default setting for locked orientation: #Not implemented. #lockFile="/tmp/lockedOrientation" #echo "0" > ${lockFile} while true; do #Check if rotation is locked. #Not implemented. locked=0 #locked=$(cat ${lockFile}) if [ ${locked} -eq 0 ]; then #Get current orientation set currentOrientation=$(xrandr --verbose | grep ${screen} | sed -e "s/.*) \([[:alpha:]]*\) (.*/\1/") case ${currentOrientation} in ${sNormal} ) currentOrientation="${normal}" ;; ${sLeft} ) currentOrientation="${left}" ;; ${sInverted} ) currentOrientation="${inverted}";; ${sRight} ) currentOrientation="${right}" ;; * ) echo "bug.";; esac #Get data from accelerometer x=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_x_raw) y=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_y_raw) z=$(cat /sys/bus/iio/devices/iio\:device0/in_accel_z_raw) nextRotation="${normal}" if [ $x -le 0 ]; then case $x in -???? ) nextRotation="${normal}";; -????? ) nextRotation="${right}";; esac fi if [ $x -ge 0 ]; then case $x in ???? ) nextRotation="${normal}";; ????? ) nextRotation="${left}";; esac fi if [ ${nextRotation} = ${normal} ]; then case $y in -????? ) nextRotation="${inverted}";; esac fi #re-orientation if [ ${nextRotation} != ${currentOrientation} ]; then xrandr -o ${nextRotation} for input in ${xinputs[@]}; do case ${nextRotation}} in ${normal} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_normal} ;; ${left} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_left} ;; ${inverted} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_inverte};; ${right} ) xinput set-prop $input "Coordinate Transformation Matrix" ${T_Matrix_right} ;; * ) echo "Bug. input=${input}, nextRotation=${nextRotation}" ;; esac done fi fi sleep ${period} done
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie