Trucs:Utiliser 2 souris en texte sur une debian
jm<jeanmarie.favreau@free.fr>
L'article Utiliser 2 souris avec XFree3 et en mode texte (console) indique comment configurer gpm pour fonctionner avec deux souris, mais concerne visiblement une machine mandrake.
Voici donc la modification équivalente à faire sur une debian (sid, mais ça doit être équivalent partout).
Éditez le fichier /etc/gpm.conf, afin qu'il ressemble à ceci (les lignes en gras sont celles qu'il faut ajouter):
device=/dev/input/mouse0
responsiveness=
repeat_type=
type=imps2
append=""
sample_rate=
two_mouses=yes
device_2=/dev/input/mouse1
responsiveness_2=
repeat_type_2=
type_2=imps2
append_2=""
sample_rate_2=
responsiveness=
repeat_type=
type=imps2
append=""
sample_rate=
two_mouses=yes
device_2=/dev/input/mouse1
responsiveness_2=
repeat_type_2=
type_2=imps2
append_2=""
sample_rate_2=
Puis modifiez le fichier /etc/init.d/gpm pour qu'il ressemble à ça (les lignes ajoutées sont en gras):
#!/bin/sh
#
# Start Mouse event server
PIDFILE=/var/run/gpm.pid
GPM=/usr/sbin/gpm
CFG=/etc/gpm.conf
test -x $GPM || exit 0
if [ "$(id -u)" != "0" ]
then
echo "You must be root to start, stop or restart gpm."
exit 1
fi
cmdln=
cmdln2=
if [ -f $CFG ]; then
. $CFG
if [ -n "$device" ]; then cmdln="$cmdln -m $device"; fi
if [ -n "$type" ]; then cmdln="$cmdln -t $type"; fi
if [ -n "$responsiveness" ]; then cmdln="$cmdln -r $responsiveness"; fi
if [ -n "$sample_rate" ]; then cmdln="$cmdln -s $sample_rate"; fi
if [ -n "$repeat_type" ]; then cmdln="$cmdln -R$repeat_type"; fi
# Yes, this /IS/ correct! There is no space after -R!!!!!!
# I reserve the right to throw manpages at anyone who disagrees.
if [ -n "$append" ]; then cmdln="$cmdln $append"; fi
if [ "$two_mouses" == "yes" ]; then
if [ -n "$device_2" ]; then cmdln_2="$cmdln_2 -m $device_2"; fi
if [ -n "$type_2" ]; then cmdln_2="$cmdln_2 -t $type_2"; fi
if [ -n "$responsiveness_2" ]; then cmdln_2="$cmdln_2 -r $responsiveness_2"; fi
if [ -n "$sample_rate_2" ]; then cmdln_2="$cmdln_2 -s $sample_rate_2"; fi
if [ -n "$repeat_type_2" ]; then cmdln_2="$cmdln_2 -R$repeat_type_2"; fi
# Yes, this /IS/ correct! There is no space after -R!!!!!!
# I reserve the right to throw manpages at anyone who disagrees.
if [ -n "$append_2" ]; then cmdln_2="$cmdln_2 $append_2"; fi
cmdln="$cmdln -M $cmdln_2"
fi
fi
gpm_strace () {
echo -n "Running mouse interface server under strace: gpm"
strace -T -o /root/gpm.strace $GPM -V -D -e $cmdln > /root/gpm.out
2>&1 echo "."
return 0
}
gpm_start () {
echo -n "Starting mouse interface server: gpm"
start-stop-daemon --start --quiet --exec $GPM -- $cmdln
echo "."
return 0
}
gpm_stop () {
echo -n "Stopping mouse interface server: gpm"
$GPM -k
echo "."
}
case "$1" in
strace)
gpm_strace
;;
start)
gpm_start
;;
stop)
gpm_stop
;;
force-reload|restart)
gpm_stop
sleep 3
gpm_start
;;
*)
echo "Usage: /etc/init.d/gpm {start|stop|restart|force-reload|strace}"
exit 1
esac
exit 0
#
# Start Mouse event server
PIDFILE=/var/run/gpm.pid
GPM=/usr/sbin/gpm
CFG=/etc/gpm.conf
test -x $GPM || exit 0
if [ "$(id -u)" != "0" ]
then
echo "You must be root to start, stop or restart gpm."
exit 1
fi
cmdln=
cmdln2=
if [ -f $CFG ]; then
. $CFG
if [ -n "$device" ]; then cmdln="$cmdln -m $device"; fi
if [ -n "$type" ]; then cmdln="$cmdln -t $type"; fi
if [ -n "$responsiveness" ]; then cmdln="$cmdln -r $responsiveness"; fi
if [ -n "$sample_rate" ]; then cmdln="$cmdln -s $sample_rate"; fi
if [ -n "$repeat_type" ]; then cmdln="$cmdln -R$repeat_type"; fi
# Yes, this /IS/ correct! There is no space after -R!!!!!!
# I reserve the right to throw manpages at anyone who disagrees.
if [ -n "$append" ]; then cmdln="$cmdln $append"; fi
if [ "$two_mouses" == "yes" ]; then
if [ -n "$device_2" ]; then cmdln_2="$cmdln_2 -m $device_2"; fi
if [ -n "$type_2" ]; then cmdln_2="$cmdln_2 -t $type_2"; fi
if [ -n "$responsiveness_2" ]; then cmdln_2="$cmdln_2 -r $responsiveness_2"; fi
if [ -n "$sample_rate_2" ]; then cmdln_2="$cmdln_2 -s $sample_rate_2"; fi
if [ -n "$repeat_type_2" ]; then cmdln_2="$cmdln_2 -R$repeat_type_2"; fi
# Yes, this /IS/ correct! There is no space after -R!!!!!!
# I reserve the right to throw manpages at anyone who disagrees.
if [ -n "$append_2" ]; then cmdln_2="$cmdln_2 $append_2"; fi
cmdln="$cmdln -M $cmdln_2"
fi
fi
gpm_strace () {
echo -n "Running mouse interface server under strace: gpm"
strace -T -o /root/gpm.strace $GPM -V -D -e $cmdln > /root/gpm.out
2>&1 echo "."
return 0
}
gpm_start () {
echo -n "Starting mouse interface server: gpm"
start-stop-daemon --start --quiet --exec $GPM -- $cmdln
echo "."
return 0
}
gpm_stop () {
echo -n "Stopping mouse interface server: gpm"
$GPM -k
echo "."
}
case "$1" in
strace)
gpm_strace
;;
start)
gpm_start
;;
stop)
gpm_stop
;;
force-reload|restart)
gpm_stop
sleep 3
gpm_start
;;
*)
echo "Usage: /etc/init.d/gpm {start|stop|restart|force-reload|strace}"
exit 1
esac
exit 0
Redémarrez gpm (/etc/init.d/gpm start), et c'est fait.