Quitter le serveur X pour lancer un outil de calibration

Bonjour à tous.

Avec le paquet xserver-xorg-input-evtouch, j’aimerais réussir à calibrer mon écran tactile. Le hic, c’est que j’ai le message suivant que j’essaie de lancer le script de calibration :

No protocol specified kdialog: cannot connect to X server :0.0

Qui saurait me donner une piste ?

Merci d’avance.

Guillaume

Quelle procédure exacte tu utilises pour lancer ton script ? C’est pas très clair, dans le titre tu parles de “quitter le serveur X”, mais clairement le script a besoin de tourner sous X.
Question subsidiaire : tu lances (ou es censé lancer) le script avec quel utilisateur ?

[quote=“syam”]Quelle procédure exacte tu utilises pour lancer ton script ? C’est pas très clair, dans le titre tu parles de “quitter le serveur X”, mais clairement le script a besoin de tourner sous X.
Question subsidiaire : tu lances (ou es censé lancer) le script avec quel utilisateur ?[/quote]
je me rends dans /usr/lib/xf86-input-evtouch et je fais un sudo ./calibrate.sh

Ça ne répond pas à la question de savoir pourquoi tu as parlé de « quitter le serveur X » mais bon c’est pas très grave. :wink:

Le problème semble être que tu as besoin de droits root pour lancer une application X, mais qu’apparemment sudo ne transfère pas correctement les cookies Xauth au script que tu lances (bien que la variable DISPLAY soit définie).
Il y a peut-être un moyen de forcer sudo à transférer correctement les cookies Xauth, mais le plus simple serait sûrement d’utiliser sux (qui est un simple su incluant le forwarding X à la session root). À lancer depuis un terminal sous X, bien sûr.
C’est mal, mais là je vois difficilement une autre solution.


En fouinant un peu entre temps, j’ai trouvé ça : wiki.archlinux.org/index.php/Tou … alibration
Ça pourra peut-être t’aider ? Je laisse quand même la réponse ci-dessus que je m’apprêtais à envoyer.

[quote]No matter whether you started it from TTY or X11, this will start a new X server and bring up a white screen. [/quote]C’était par rapport à ça que tu parlais de « quitter le serveur X » ?

et sans sudo depuis une fenêtre teminal avec X?
grosguillaume en parle plus haut…
Edit
je vouais dire syam

[quote=“syam”]

Oui :smt003

Là encore, je me fade un No protocol specified kdialog: cannot connect to X server :0.0

Sous KUbuntu, aucun souci pour le lancer, ce :smt030 de script :smt005

Guillaume

donne nous le contenu du calibrate.sh

[code]#!/bin/bash
XINIT=which xinit
XSERVER=which X
EVCALIBRATE=which ev_calibrate || echo ./ev_calibrate
UDI=$(hal-find-by-property --key input.x11_driver --string evtouch)
MYDPY=":1.0"
ZENITY=which zenity
KDIALOG=which kdialog
XDIALOG=which Xdialog

INFO=“You have selected to (re)calibrate your touchscreen.\n\n
Move your pen around all edges on the following screen.\n\n
If you are done and touched all edges, hit the enter key and wait until
the top left crosshair turns red.\nOnce you tap the red crosshair,
the next one will turn red going from the top left to the
bottom right.\nIf you miss a tap, the right mouse button will
take you back one step.\n\n
If you tapped the last (bottom right) crosshair, the program will
return to your session. Note that changes only take effect after
restarting the session.”

RESTARTINFO=“Touchscreen calibration done\nPlease restart your
session to \nmake the changes take effect”

FAILINFO=“No evtouch capable device found, if you are sure you have \n
an evtouch capable touchscreen, please mail the
resulting file of the command “lshal > evtouch_hal.out” to the\n
ubuntu-mobile@lists.ubuntu.com mailing list, so support for your
device can be added.”

if [ -z “$UDI” ];then
if [ -x “${ZENITY}” ]; then
$ZENITY --info --text="${FAILINFO}"
elif [ -x “${XDIALOG}” ]; then
$XDIALOG --fill --msgbox “${FAILINFO}” 20 40
elif [ -x “${KDIALOG}” ]; then
$KDIALOG --msgbox "${FAILINFO}"
fi
exit 0
fi

if [ -x “${ZENITY}” ]; then
$ZENITY --info --text="${INFO}"
elif [ -x “${XDIALOG}” ]; then
$XDIALOG --fill --msgbox “${INFO}” 30 40
elif [ -x “${KDIALOG}” ]; then
$KDIALOG --msgbox "${INFO}"
fi

echo $EVCALIBRATE

if [ -n “$DISPLAY” ]; then
DPY=$(echo $DISPLAY|sed -e ‘s/[a-z:]*//g’|cut -d’.’ -f1)
MYDPY=":$(($DPY+1)).0"
fi

if ! [ -x “$EVCALIBRATE” ] ; then
echo "ev_calibrate not found exiting …"
exit 1;
fi
echo “evalibrate located at $EVCALIBRATE”

if [ -z “$XINIT” ]; then
echo "xinit not found exiting …"
exit 1;
fi
echo "xinit located at $XINIT"
if [ -z “$XSERVER” ]; then
echo "X not found exiting …"
exit 1;
fi
echo "xserver located at $XSERVER"
if [ -e /tmp/ev_calibrate ]; then
rm /tmp/ev_calibrate;
fi
echo "Creating FIFO…"
mknod /tmp/ev_calibrate p

#for development only :slight_smile:
#cp evtouch_drv.o /usr/X11R6/lib/modules/input
#xinit /usr/bin/ddd ev_calibrate – /usr/X11R6/bin/X
echo "Starting calibration program…"
sleep 2
hal-set-property --udi $UDI --key input.x11_options.calibrate --string “1”

$XINIT $EVCALIBRATE – $XSERVER $MYDPY -auth /dev/null

hal-set-property --remove --udi $UDI --key input.x11_options.calibrate

invoke-rc.d --quiet xserver-xorg-input-evtouch start

rm /tmp/ev_calibrate

if [ -x “${ZENITY}” ]; then
$ZENITY --info --text="${RESTARTINFO}"
elif [ -x “${XDIALOG}” ]; then
$XDIALOG --fill --msgbox “${RESTARTINFO}” 10 40
elif [ -x “${KDIALOG}” ]; then
$KDIALOG --msgbox "${RESTARTINFO}"
fi

exit 0[/code]

donne nous le
echo $DISPLAY

et lance le calibrate avec un export avant
export DISPLAY=:0

si non
export DISPLAY=“localhost:0.0”

sans le sudo, avec le même user qui a lancé le X (le tt sous root c’est encore mieux)

Le DISPLAY est correct mais root n’a pas les droits d’accès à ton serveur X. Utilise sux, ou bien fais un

ln -s /home/toi/.Xauthority /root/.Xauthority

et relance ton truc. Ça marchera.

[quote=“fran.b”]Le DISPLAY est correct mais root n’a pas les droits d’accès à ton serveur X. Utilise sux, ou bien fais un

ln -s /home/toi/.Xauthority /root/.Xauthority

et relance ton truc. Ça marchera.[/quote]
Arghhhh… Effectivement, avec sux, ça fonctionne, mais pour me dire que je n’ai pas d’écran “evtouch capable” :smt003

Pourtant, sous Kubuntu, il est très “evtouch capable” :smt033

Guillaume