1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../gpm/stone_mod_gpm.sh
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 # [MAIN] 40 gpm General Purpose Mouse (GPM) Daemon
19 cat << EOT > /etc/conf/gpm
20 GPM_MOUSE="$GPM_MOUSE"
21 GPM_ARGS="`echo -t $GPM_TYPE -$GPM_BUTTONS $GPM_ARGS`"
27 "Select the mouse port. (Current: $GPM_MOUSE)" \
28 'All input layer events . /dev/input/mice' 'GPM_MOUSE=/dev/input/mice' \
29 'Input layer mouse 0 .... /dev/input/mouse0' 'GPM_MOUSE=/dev/input/mouse0' \
30 'Input layer mouse 1 .... /dev/input/mouse1' 'GPM_MOUSE=/dev/input/mouse1' \
31 'TTS 0 (aka COM 1) ...... /dev/tts/0' 'GPM_MOUSE=/dev/tts/0' \
32 'TTS 1 (aka COM 2) ...... /dev/tts/1' 'GPM_MOUSE=/dev/tts/1' \
33 'TTS 2 (aka COM 3) ...... /dev/tts/2' 'GPM_MOUSE=/dev/tts/2' \
34 'TTS 3 (aka COM 4) ...... /dev/tts/3' 'GPM_MOUSE=/dev/tts/3' \
35 'PSAUX (aka PS/2) ....... /dev/misc/psaux' 'GPM_MOUSE=/dev/misc/psaux' \
36 'SUNMOUSE (SBUS) ........ /dev/misc/sunmouse' 'GPM_MOUSE=/dev/misc/sunmouse'
41 cmd
="gui_menu gpm_type 'Select the mouse type."
42 cmd
="$cmd (Current: $GPM_TYPE)'" ; x
="'"
43 while read type desc
; do
44 cmd
="$cmd '$type - ${desc//$x/$x\\$x$x}' 'GPM_TYPE=$type'"
45 done < <( gpm
-m $GPM_MOUSE -t help |
grep '^[ \*] [^ ]' | cut
-c3- )
46 eval "$cmd" ; write_config
50 gui_menu gpm_buttons \
51 "Select the number of mouse buttons. (Current: $GPM_BUTTONS)" \
52 'This is a mouse with 2 buttons' 'GPM_BUTTONS=2' \
53 'This is a mouse with 3 buttons' 'GPM_BUTTONS=3'
58 gui_input
"Extra options for the gpm daemon (Current: $GPM_ARGS)" \
59 "$GPM_ARGS" "GPM_ARGS"
65 GPM_MOUSE
="/dev/misc/psaux" ; GPM_ARGS
="-t ms -2"
66 [ -f /etc
/conf
/gpm
] && .
/etc
/conf
/gpm
68 set -- $GPM_ARGS ; GPM_ARGS
=""
70 if [ "$1" = "-t" ] ; then
72 elif [ -z "${1#-[23]}" ] ; then
75 GPM_ARGS
="$GPM_ARGS $1"
80 gui_menu gpm
'General Purpose Mouse (GPM) Daemon Configuration.
81 Select an item to change the value:' \
82 "Mouse Port ........ $GPM_MOUSE" 'set_port' \
83 "Mouse Type ........ $GPM_TYPE" 'set_type' \
84 "Mouse Buttons ..... $GPM_BUTTONS" 'set_buttons' \
85 "Extra Options ..... $GPM_ARGS" 'set_args' \
87 'Edit the /etc/conf/gpm file' \
88 "gui_edit 'GPM Config File' /etc/conf/gpm" \
89 'Configure runlevels for GPM service' \
90 '$STONE runlevel edit_srv gpm' \
91 '(Re-)Start gpm init script' \
92 '$STONE runlevel restart gpm'