3 # Switch the keyboard to en-us by default, bepo, or en-dvorak.
6 print 'switch-kbd - helper for setxkbmap'
8 print 'Change the keyboard to en-us, fr-bepo, or en-dvorak.'
9 print 'Uses setxkbmap, so the change only affects the current'
10 print 'session. This mainly to avoid using a toggle key.'
14 print ' -n do not execute'
15 print ' -h help text.'
17 print ' The default is to set the keyboard to en-us.'
26 # $opt will hold the current option
28 while getopts bdnvh opt; do
29 # loop continues till options finished
30 # see which pattern $opt matches...
34 variant="-variant bepo"
39 variant="-variant dvorak"
50 # matches a question mark
51 # (and nothing else, see text)
53 print "Bad option:" $*
60 (( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
61 ##print Remaining arguments are: $*
63 mycommand='setxkbmap '${layout}' '${variant}
65 if [[ ( $verbose -ne 0 ) ]]; then;
66 print "setxkbmap Command:" $mycommand
69 if [[ ( $execute -ne 0 ) ]]
73 print "did not execute"