set_keyboard_layout revision 48784e40877057cd7d3ffdeabfb3a76bf5d980fc
2N/A#! /usr/bin/sh
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License, Version 1.0 only
2N/A# (the "License"). You may not use this file except in compliance
2N/A# with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A#
2N/A# ident "%Z%%M% %I% %E% SMI"
2N/A#
2N/A# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
2N/A# Use is subject to license terms.
2N/A#
2N/A
2N/AKBD_TYPE=`/usr/bin/kbd -t`
# (Really, should pick this up from the keyboard device node keyboard-type
# value, or the 1275 PC keyboard binding "layout" property.)
KBD_LAYOUT_NAME="`/usr/sbin/eeprom kbd-type | /usr/bin/sed -n s/kbd-type=//p`"
case "$KBD_TYPE" in
"USB keyboard")
case "$KBD_LAYOUT_NAME" in
"") LAYOUT= ;;
"Belgian" ) LAYOUT=2 ;;
"Czech" ) LAYOUT= ;;
"Danish" ) LAYOUT=6 ;;
"Dutch" ) LAYOUT=18 ;;
"Finnish" ) LAYOUT=7 ;;
"French" ) LAYOUT=8 ;;
"French-Canadian" ) LAYOUT= ;;
"German" ) LAYOUT=9 ;;
"Greek" ) LAYOUT= ;;
"Hungarian" ) LAYOUT= ;;
"Italian" ) LAYOUT=14 ;;
"Japanese(106)" ) LAYOUT=15 ;;
"Japanese(J3100)" ) LAYOUT= ;;
"Latvian" ) LAYOUT= ;;
"Lithuanian" ) LAYOUT= ;;
"Polish" ) LAYOUT= ;;
"Korean" ) LAYOUT=16 ;;
"Norwegian" ) LAYOUT=19 ;;
"Portuguese" ) LAYOUT=22 ;;
"Russian" ) LAYOUT=23 ;;
"Spanish" ) LAYOUT=25 ;;
"Swedish" ) LAYOUT=26 ;;
"Swiss-French" ) LAYOUT=27 ;;
"Swiss-German" ) LAYOUT=28 ;;
"Taiwanese" ) LAYOUT=30 ;;
"Turkish" ) LAYOUT= ;;
"UK-English" ) LAYOUT=32 ;;
"US-English" ) LAYOUT=33 ;;
"US-English(Microsoft-Natural)" ) LAYOUT=33 ;;
"US-English(104-Key)" ) LAYOUT=33 ;;
*) LAYOUT= ;;
esac
;;
"PC")
case "$KBD_LAYOUT_NAME" in
"") LAYOUT= ;;
"Belgian" ) LAYOUT=2 ;;
"Czech" ) LAYOUT=53 ;;
"Danish" ) LAYOUT=36 ;;
"Dutch" ) LAYOUT=39 ;;
"Finnish" ) LAYOUT=7 ;;
"French" ) LAYOUT=35 ;;
"French-Canadian" ) LAYOUT=50 ;;
"German" ) LAYOUT=37 ;;
"Greek" ) LAYOUT=57 ;;
"Hungarian" ) LAYOUT=51 ;;
"Italian" ) LAYOUT=38 ;;
"Japanese(106)" ) LAYOUT=49 ;;
"Japanese(J3100)" ) LAYOUT=34 ;;
"Latvian" ) LAYOUT=55 ;;
"Lithuanian" ) LAYOUT=59 ;;
"Polish" ) LAYOUT=52 ;;
"Korean" ) LAYOUT=47 ;;
"Norwegian" ) LAYOUT=40 ;;
"Portuguese" ) LAYOUT=41 ;;
"Russian" ) LAYOUT=54 ;;
"Spanish" ) LAYOUT=42 ;;
"Swedish" ) LAYOUT=43 ;;
"Swiss-French" ) LAYOUT=44 ;;
"Swiss-German" ) LAYOUT=45 ;;
"Taiwanese" ) LAYOUT=48 ;;
"Turkish" ) LAYOUT=56 ;;
"UK-English" ) LAYOUT=46 ;;
"US-English" ) LAYOUT=1 ;;
"US-English(Microsoft-Natural)" ) LAYOUT=1001 ;;
"US-English(104-Key)" ) LAYOUT=1001 ;;
*) LAYOUT=0 ;;
esac
;;
esac
if test -n "$LAYOUT"
then
# Set the layout for a non-self-ID keyboard.
# loadkeys -s is a project private interface, and subject to change
# without notice.
/usr/bin/loadkeys -s $LAYOUT
fi