script de calibration ecran tactile [Réglé]
besoin d'aide pour dechiffer sed
Système et matériels / Installation et configuration
-
- Voir le profil du membre Anonymous23
- Inscrit le : 19/03/2022
- Groupes :
-
Forgeron
J'ai recupéré une vielle tablette 2 en 1 Wind'tab 89 Storex
J'ai installé Mageia 9 et je souhaite calibrer l'écran tactile.
Trouvé ce script:
Code BASH :
#!/bin/bash #all credit to Mogwai. Script taken from url: https://wiki.archlinux.org/index.php/Talk:Calibrating_Touchscreen device=$(xinput_calibrator --list) device=$(sed -n 's/.*Device\s\"\(.*\)\".*/\1/p' <<< $device) #reset xinput matrix xinput set-prop "$device" 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1 out=$(xinput_calibrator) device_name=$(sed -n 's/.*MatchProduct\"\s\"\([0-9]*\).*/\1/p' <<< $out) wtot=$(sed -n 's/.*max_x=\([0-9]*\).*/\1/p' <<< $out) htot=$(sed -n 's/.*max_y=\([0-9]*\).*/\1/p' <<< $out) minx=$(sed -n 's/.*MinX\"\s\"\([0-9]*\).*/\1/p' <<< $out) maxx=$(sed -n 's/.*MaxX\"\s\"\([0-9]*\).*/\1/p' <<< $out) miny=$(sed -n 's/.*MinY\"\s\"\([0-9]*\).*/\1/p' <<< $out) maxy=$(sed -n 's/.*MaxY\"\s\"\([0-9]*\).*/\1/p' <<< $out) wtouch=$(bc <<< "$maxx - $minx") htouch=$(bc <<< "$maxy - $miny") c0=$(bc -l <<< "$wtot / $wtouch") c1=$(bc -l <<< "-$minx / $wtouch") c2=$(bc -l <<< "$htot / $htouch") c3=$(bc -l <<< "-$miny / $htouch") tf_matrix="$c0 0 $c1 0 $c2 $c3 0 0 1" #alter the setting for now xinput set-prop "$device" 'Coordinate Transformation Matrix' $tf_matrix echo "To make this permanent, save the following content under '/etc/X11/xorg.conf.d/98-screen-calibration.conf' or '/usr/share/X11/xorg.conf.d/98-screen-calibration.conf'" echo "Section \"InputClass\"" echo " Identifier \"calibration\"" echo " MatchProduct \"$device\"" echo " Option \"TransformationMatrix\" \"$tf_matrix\"" echo "EndSection"
Je veux modifier les quatre lignes successives contenant la commande sed et pour ce faire je souhaite comprendre ce qu'elles font.
Quelqu'un m'aiderait il?
Merci
Dell Précision 5520 et 7810. MGA9 Mate et KDE et Librazik 4

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron

s pour substitute. sxxx avec x comme séparateur de commande, ou s/// avec / comme séparateur, n'importe quel caractere fait l'affaire. Ici, ils ont pris /.
s/ce qu'on cherche/par ce qu'on remplace/
On peut définir des groupes \(\) dans ce qu'on cherche pour les réutiliser dans ce qu'on remplace par ordre d'apparition \1, \2, etc
Puis il y a les classe de caractère, par bande de 1 à 5 : [1-5] de 0 à 9 [0-9] ou en label [:digit
![:]](/images/smileys/8.gif)
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 |
-
- Voir le profil du membre Anonymous23
- Inscrit le : 19/03/2022
- Groupes :
-
Forgeron
Grâce à toi j'ai compris
Bonne soirée
Dell Précision 5520 et 7810. MGA9 Mate et KDE et Librazik 4
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie