Deleted Added
full compact
saver (252995) saver (263791)
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 (INCLUDING, 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#
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 (INCLUDING, 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: stable/9/usr.sbin/bsdconfig/console/saver 252995 2013-07-07 19:13:34Z dteske $
27# $FreeBSD: stable/9/usr.sbin/bsdconfig/console/saver 263791 2014-03-27 03:20:47Z 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
36f_include $BSDCFG_SHARE/sysrc.subr
37
38BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console"
39f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
40
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
36f_include $BSDCFG_SHARE/sysrc.subr
37
38BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console"
39f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
40
41ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
42[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
41f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
42 pgm="${ipgm:-$pgm}"
43
44############################################################ FUNCTIONS
45
46# dialog_menu_main
47#
48# Display the dialog(1)-based application main menu.
49#
50dialog_menu_main()

--- 88 unchanged lines hidden (view full) ---

139dialog_menu_main || f_die
140f_dialog_menutag_fetch mtag
141
142case "$mtag" in
143"$msg_timeout") # Set the screen saver timeout interval
144 f_dialog_title "$msg_value_required"
145 f_dialog_input blanktime "$msg_enter_timeout_period" \
146 "$( f_sysrc_get blanktime )" &&
43
44############################################################ FUNCTIONS
45
46# dialog_menu_main
47#
48# Display the dialog(1)-based application main menu.
49#
50dialog_menu_main()

--- 88 unchanged lines hidden (view full) ---

139dialog_menu_main || f_die
140f_dialog_menutag_fetch mtag
141
142case "$mtag" in
143"$msg_timeout") # Set the screen saver timeout interval
144 f_dialog_title "$msg_value_required"
145 f_dialog_input blanktime "$msg_enter_timeout_period" \
146 "$( f_sysrc_get blanktime )" &&
147 f_sysrc_set blanktime "$blanktime" || f_die
147 f_eval_catch "$0" f_sysrc_set \
148 'f_sysrc_set blanktime "%s"' "$blanktime" || f_die
148 f_dialog_title_restore
149 exit $SUCCESS
150esac
151
152saver_to_set=
153case "$mtag" in
154"1 $msg_none") # Disable the screensaver
155 saver_to_set="NO" ;;

--- 19 unchanged lines hidden (view full) ---

175 saver_to_set="snake" ;;
176"c $msg_star") # A "twinkling stars" effect
177 saver_to_set="star" ;;
178"d $msg_warp") # A "stars warping" effect
179 saver_to_set="warp" ;;
180esac
181
182if [ "$saver_to_set" ]; then
149 f_dialog_title_restore
150 exit $SUCCESS
151esac
152
153saver_to_set=
154case "$mtag" in
155"1 $msg_none") # Disable the screensaver
156 saver_to_set="NO" ;;

--- 19 unchanged lines hidden (view full) ---

176 saver_to_set="snake" ;;
177"c $msg_star") # A "twinkling stars" effect
178 saver_to_set="star" ;;
179"d $msg_warp") # A "stars warping" effect
180 saver_to_set="warp" ;;
181esac
182
183if [ "$saver_to_set" ]; then
183 f_sysrc_set saver "$saver_to_set" || f_die
184 f_eval_catch "$0" f_sysrc_set \
185 'f_sysrc_set saver "%s"' "$saver_to_set" || f_die
184 break
185else
186 f_die 1 "$msg_unknown_saver"
187fi
188
189exit $SUCCESS
190
191################################################################################
192# END
193################################################################################
186 break
187else
188 f_die 1 "$msg_unknown_saver"
189fi
190
191exit $SUCCESS
192
193################################################################################
194# END
195################################################################################