Magellan Linux

Contents of /mcore-src/trunk/mcore-tools/daemon/client/include/input.client.class

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1921 - (show annotations) (download)
Wed Nov 9 13:37:54 2011 UTC (12 years, 5 months ago) by niro
File size: 1308 byte(s)
-requires fluxbox
-support get input.keymap
-support keyboard rate setup
-improved help descriptions
1 # $Id$
2
3 provide basic-input
4 require fluxbox
5
6 help_input_keymap()
7 {
8 mecho "get input.keymap"
9 mecho " prints current keymap of xorg"
10 mecho
11 mecho "set input.keymap [keymap]"
12 mecho " set keymap of xorg to [keymap]"
13 mecho " keymaps may be: de, us, en, gr, etc"
14 }
15
16 # set_input_mouse
17 set_input_mouse()
18 {
19 return 0
20 }
21
22 # set_input_keyboard
23 set_input_keyboard()
24 {
25 local value="$1"
26 local rate
27 local CONFIG="${MCORE_CONFIG_PATH}/fluxbox/autostart/keyboard"
28
29 case ${value} in
30 slow) rate="1000 10" ;;
31 fast) rate="250 100" ;;
32 normal) rate="" ;;
33 *) help_input_keyboard && return 1 ;;
34 esac
35
36 clearconfig
37 addconfig "# ${value}"
38 addconfig "[startup] { nohup xset r rate ${rate} &}"
39
40 # rebuild autostart file
41 helper_rebuild_fluxbox_autostart
42
43 x11runas "xset r rate ${rate}"
44 }
45
46 get_input_keymap()
47 {
48 local keymap
49 keymap=$(x11runas "setxkbmap -query" | grep layout | awk '{print $2}')
50 rvecho "keymap"
51 }
52
53 # set_input_keyboard
54 set_input_keymap()
55 {
56 local value="$1"
57 local CONFIG="/etc/X11/xorg.conf.d/25-layout.conf"
58
59 [[ -z ${value} ]] && help_input_keymap && return 1
60
61 clearconfig
62
63 addconfig 'Section "InputClass"'
64 addconfig ' Identifier "keyboard layout"'
65 addconfig ' MatchIsKeyboard "on"'
66 addconfig " Option \"XkbLayout\" \"${value}\""
67 addconfig 'EndSection'
68
69 x11runas "setxkbmap ${value}"
70 }