1230557Sjimharris#!/bin/sh 2230557Sjimharris#- 3230557Sjimharris# Copyright (c) 2012-2013 Devin Teske 4230557Sjimharris# All rights reserved. 5230557Sjimharris# 6230557Sjimharris# Redistribution and use in source and binary forms, with or without 7230557Sjimharris# modification, are permitted provided that the following conditions 8230557Sjimharris# are met: 9230557Sjimharris# 1. Redistributions of source code must retain the above copyright 10230557Sjimharris# notice, this list of conditions and the following disclaimer. 11230557Sjimharris# 2. Redistributions in binary form must reproduce the above copyright 12230557Sjimharris# notice, this list of conditions and the following disclaimer in the 13230557Sjimharris# documentation and/or other materials provided with the distribution. 14230557Sjimharris# 15230557Sjimharris# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16230557Sjimharris# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17230557Sjimharris# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18230557Sjimharris# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19230557Sjimharris# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20230557Sjimharris# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21230557Sjimharris# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22230557Sjimharris# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23230557Sjimharris# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24230557Sjimharris# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25230557Sjimharris# SUCH DAMAGE. 26230557Sjimharris# 27230557Sjimharris# $FreeBSD: releng/10.3/usr.sbin/bsdconfig/mouse/flags 260678 2014-01-15 07:49:17Z dteske $ 28230557Sjimharris# 29230557Sjimharris############################################################ INCLUDES 30230557Sjimharris 31230557SjimharrisBSDCFG_SHARE="/usr/share/bsdconfig" 32230557Sjimharris. $BSDCFG_SHARE/common.subr || exit 1 33230557Sjimharrisf_dprintf "%s: loading includes..." "$0" 34230557Sjimharrisf_include $BSDCFG_SHARE/dialog.subr 35230557Sjimharrisf_include $BSDCFG_SHARE/mustberoot.subr 36230557Sjimharrisf_include $BSDCFG_SHARE/sysrc.subr 37230557Sjimharris 38230557SjimharrisBSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" 39230557Sjimharrisf_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr 40230557Sjimharris 41230557Sjimharrisf_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm && 42230557Sjimharris pgm="${ipgm:-$pgm}" 43230557Sjimharris 44230557Sjimharris############################################################ CONFIGURATION 45230557Sjimharris 46230557Sjimharris# 47230557Sjimharris# Location of moused(8) pidfile 48230557Sjimharris# 49230557SjimharrisMOUSED_PIDFILE=/var/run/moused.pid 50230557Sjimharris 51230557Sjimharris############################################################ MAIN 52230557Sjimharris 53230557Sjimharris# Incorporate rc-file if it exists 54230557Sjimharris[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" 55230557Sjimharris 56230557Sjimharris# 57230557Sjimharris# Process command-line arguments 58230557Sjimharris# 59230557Sjimharriswhile getopts h$GETOPTS_STDARGS flag; do 60230557Sjimharris case "$flag" in 61230557Sjimharris h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm" ;; 62230557Sjimharris esac 63230557Sjimharrisdone 64230557Sjimharrisshift $(( $OPTIND - 1 )) 65230557Sjimharris 66230557Sjimharris# 67230557Sjimharris# Initialize 68230557Sjimharris# 69230557Sjimharrisf_dialog_title "$msg_mouse_flags" 70230557Sjimharrisf_dialog_backtitle "${ipgm:+bsdconfig }$pgm" 71230557Sjimharrisf_mustberoot_init 72230557Sjimharris 73230557Sjimharris# 74230557Sjimharris# Get the current flags 75230557Sjimharris# 76230557Sjimharrisflags=$( f_sysrc_get moused_flags ) 77230557Sjimharris 78230557Sjimharris# 79230557Sjimharris# Prompt the user with the current value 80230557Sjimharris# 81230557Sjimharrisf_dialog_title "$msg_value_required" 82230557Sjimharrisf_dialog_input flags "$msg_please_specify_the_mouse_daemon_flags" \ 83230557Sjimharris "$flags" || f_die 84230557Sjimharrisf_dialog_title_restore 85230557Sjimharris 86230557Sjimharris# 87230557Sjimharris# Save the new value 88230557Sjimharris# 89230557Sjimharrisf_eval_catch "$0" f_sysrc_set 'f_sysrc_set moused_flags "%s"' "$flags" || f_die 90230557Sjimharris 91230557Sjimharrisexit $SUCCESS 92230557Sjimharris 93230557Sjimharris################################################################################ 94230557Sjimharris# END 95230557Sjimharris################################################################################ 96230557Sjimharris