1#!/bin/sh
2#-
3# Copyright (c) 2012-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/console/keymap 251190 2013-05-31 19:07:17Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." "$0"
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/mustberoot.subr
--- 152 unchanged lines hidden (view full) ---
188 [ "$defaultitem" = "$1" ] && break
189 [ " $defaultitem" = "$1" ] && exit 0
190 shift 2 # tag/item
191 done
192 exit 1 # No modification needed
193 ) && defaultitem=" $defaultitem"
194 fi
195
196 local dialog_menu
197 dialog_menu=$( eval $DIALOG \
198 --title \"\$DIALOG_TITLE\" \
199 --backtitle \"\$DIALOG_BACKTITLE\" \
200 --hline \"\$hline\" \
201 --ok-label \"\$msg_ok\" \
202 --cancel-label \"\$msg_cancel\" \
203 --default-item \"\$defaultitem\" \
204 --menu \"\$prompt\" \
205 $height $width $rows \
206 $menu_list \
207 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
208 )
209 local retval=$?
210 setvar DIALOG_MENU_$$ "$dialog_menu"
211 return $retval
212}
213
214############################################################ MAIN
215
216# Incorporate rc-file if it exists
217[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"
218
--- 13 unchanged lines hidden (view full) ---
232f_dialog_title "$msg_system_console_keymap"
233f_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
234f_mustberoot_init
235
236#
237# Launch application main menu
238#
239while :; do
240 dialog_menu_main
241 retval=$?
242 mtag=$( f_dialog_menutag )
243
244 [ $retval -eq 0 ] || f_die
245
246 #
247 # Reverse the users choice into the variable name
248 #
249 keymap_name=
250 mtag="${mtag# }" # remove single leading-space if-present
251 for name in $KEYMAP_NAMES; do
252 if [ "$( eval echo \"\$msg_$name\" )" = "$mtag" ]; then
253 keymap_name="$name"
--- 195 unchanged lines hidden ---
2#-
3# Copyright (c) 2012-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/console/keymap 251190 2013-05-31 19:07:17Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." "$0"
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/mustberoot.subr
--- 152 unchanged lines hidden (view full) ---
188 [ "$defaultitem" = "$1" ] && break
189 [ " $defaultitem" = "$1" ] && exit 0
190 shift 2 # tag/item
191 done
192 exit 1 # No modification needed
193 ) && defaultitem=" $defaultitem"
194 fi
195
196 local dialog_menu
197 dialog_menu=$( eval $DIALOG \
198 --title \"\$DIALOG_TITLE\" \
199 --backtitle \"\$DIALOG_BACKTITLE\" \
200 --hline \"\$hline\" \
201 --ok-label \"\$msg_ok\" \
202 --cancel-label \"\$msg_cancel\" \
203 --default-item \"\$defaultitem\" \
204 --menu \"\$prompt\" \
205 $height $width $rows \
206 $menu_list \
207 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
208 )
209 local retval=$?
210 setvar DIALOG_MENU_$$ "$dialog_menu"
211 return $retval
212}
213
214############################################################ MAIN
215
216# Incorporate rc-file if it exists
217[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"
218
--- 13 unchanged lines hidden (view full) ---
232f_dialog_title "$msg_system_console_keymap"
233f_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
234f_mustberoot_init
235
236#
237# Launch application main menu
238#
239while :; do
240 dialog_menu_main
241 retval=$?
242 mtag=$( f_dialog_menutag )
243
244 [ $retval -eq 0 ] || f_die
245
246 #
247 # Reverse the users choice into the variable name
248 #
249 keymap_name=
250 mtag="${mtag# }" # remove single leading-space if-present
251 for name in $KEYMAP_NAMES; do
252 if [ "$( eval echo \"\$msg_$name\" )" = "$mtag" ]; then
253 keymap_name="$name"
--- 195 unchanged lines hidden ---