#!/bin/sh # ckbcomp-mini -- convert XKB specification to loadkeys/kbdcontrol format # Copyright (c) 2006,2009,2011 Anton Zinoviev # Permission is hereby granted, free of charge, to any person # obtaining a copy of this file (the "Program"), to deal in the # Program without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, # sublicense, and/or sell copies of the Program, and to permit # persons to whom the Program is furnished to do so, subject to # the following conditions: The above copyright notice and this # permission notice shall be included in all copies or substantial # portions of the Program. # THE PROGRAM IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE PROGRAM OR THE USE OR # OTHER DEALINGS IN THE PROGRAM. # Default values: model=pc105 layout='' variant='' options='' charmap='' compose_charmap='' freebsd='' verbose_option=no installdir=${0%/*} case "$installdir" in */bin) installdir=${installdir%/bin} ;; *) installdir=$installdir/.. ;; esac datadir=$installdir/share/console-setup [ -d "$datadir" ] || datadir=/usr/share/console-setup # The same as /usr/bin/which - in order to make "which" available in # environments where "which" does not exist which () { local IFS IFS=: for i in $PATH; do if [ -x "$i/$1" ]; then echo "$i/$1" return 0 fi done return 1 } while [ "$*" ]; do case "$1" in -I*) datadir=${1#-I} ;; -model) shift model="$1" ;; -layout) shift layout=">$1" ;; -variant) shift variant=">$1" ;; -option) shift options=$(echo $options $1 | sed 's/,/ /g') ;; -charmap) shift charmap=`echo "$1"|sed 's/-//g'` ;; -ccharmap) shift compose_charmap=`echo "$1"|sed 's/-//g'` ;; -backspace) shift ;; -freebsd) freebsd=yes ;; -\?|-help) cat >&2 < [ [