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/mouse/port 251236 2013-06-01 23:58:44Z 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 --- 38 unchanged lines hidden (view full) --- 74 /dev/psm0) defaultitem="1 $msg_ps2" ;; 75 /dev/cuau0) defaultitem="2 $msg_com1" ;; 76 /dev/cuau1) defaultitem="3 $msg_com2" ;; 77 /dev/cuau2) defaultitem="4 $msg_com3" ;; 78 /dev/cuau3) defaultitem="5 $msg_com4" ;; 79 /dev/mse0) defaultitem="6 $msg_busmouse" ;; 80 esac 81 |
82 local menu_choice 83 menu_choice=$( eval $DIALOG \ |
84 --title \"\$DIALOG_TITLE\" \ 85 --backtitle \"\$DIALOG_BACKTITLE\" \ 86 --hline \"\$hline\" \ 87 --ok-label \"\$msg_ok\" \ 88 --cancel-label \"\$msg_cancel\" \ 89 --default-item \"\$defaultitem\" \ 90 --menu \"\$prompt\" \ 91 $height $width $rows \ 92 $menu_list \ 93 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 94 ) 95 local retval=$? |
96 f_dialog_menutag_store -s "$menu_choice" |
97 return $retval 98} 99 100############################################################ MAIN 101 102# Incorporate rc-file if it exists 103[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" 104 --- 13 unchanged lines hidden (view full) --- 118f_dialog_title "$msg_select_your_mouse_port_from_the_following_menu" 119f_dialog_backtitle "${ipgm:+bsdconfig }$pgm" 120f_mustberoot_init 121 122# 123# Launch application main menu 124# 125while :; do |
126 dialog_menu_main || f_die 127 f_dialog_menutag_fetch mtag |
128 |
129 case "$mtag" in 130 "1 $msg_ps2") # PS/2 style mouse (/dev/psm0) 131 f_sysrc_set moused_port "/dev/psm0" || f_die 132 break ;; 133 "2 $msg_com1") # Serial mouse on COM1 (/dev/cuau0) 134 f_sysrc_set moused_port "/dev/cuau0" || f_die 135 break ;; 136 "3 $msg_com2") # Serial mouse on COM2 (/dev/cuau1) --- 20 unchanged lines hidden --- |