1209513Simp#!/bin/sh 2209513Simp#- 3209552Simp# Copyright (c) 2010 iXsystems, Inc. All rights reserved. 4209513Simp# 5209513Simp# Redistribution and use in source and binary forms, with or without 6209513Simp# modification, are permitted provided that the following conditions 7209513Simp# are met: 8209513Simp# 1. Redistributions of source code must retain the above copyright 9209513Simp# notice, this list of conditions and the following disclaimer. 10209513Simp# 2. Redistributions in binary form must reproduce the above copyright 11209513Simp# notice, this list of conditions and the following disclaimer in the 12209513Simp# documentation and/or other materials provided with the distribution. 13209513Simp# 14209513Simp# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15209513Simp# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16209513Simp# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17209513Simp# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18209513Simp# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19209513Simp# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20209513Simp# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21209513Simp# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22209513Simp# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23209513Simp# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24209513Simp# SUCH DAMAGE. 25209513Simp# 26209513Simp# $FreeBSD: releng/11.0/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh 218803 2011-02-18 15:52:57Z jpaetzel $ 27209513Simp 28209513SimpFOUND="0" 29218802SjpaetzelTMPLIST="/tmp/.xkeyList.$$" 30218802SjpaetzelXLST="/usr/local/share/X11/xkb/rules/xorg.lst" 31209513Simp 32218802Sjpaetzelif [ ! -e "${XLST}" ] ; then 33218802Sjpaetzel exit 1 34218802Sjpaetzelfi 35218802Sjpaetzel 36209513Simp# Lets parse the xorg.list file, and see what layouts are supported 37209513Simpwhile read line 38209513Simpdo 39209513Simp 40209513Simp if [ "$FOUND" = "1" -a ! -z "$line" ] 41209513Simp then 42209513Simp echo $line | grep '! ' >/dev/null 2>/dev/null 43209513Simp if [ "$?" = "0" ] 44209513Simp then 45218802Sjpaetzel break 46209513Simp else 47218802Sjpaetzel echo "$line" >> ${TMPLIST} 48209513Simp fi 49209513Simp fi 50209513Simp 51209513Simp if [ "${FOUND}" = "0" ] 52209513Simp then 53209513Simp echo $line | grep '! layout' >/dev/null 2>/dev/null 54209513Simp if [ "$?" = "0" ] 55209513Simp then 56209513Simp FOUND="1" 57209513Simp fi 58209513Simp fi 59209513Simp 60218802Sjpaetzeldone < $XLST 61209513Simp 62218802Sjpaetzelsort -b -d +1 $TMPLIST 63218802Sjpaetzel 64218802Sjpaetzel# Delete the tmp file 65218802Sjpaetzelrm $TMPLIST 66218802Sjpaetzel 67209513Simpexit 0 68