divert(-1)
# AnotherLevel - A FVWM2 Configuration
# Copyright (C) 1996, 1997 Red Hat Software, Inc
#
#	$Id: fvwm2rc.xlock.m4,v 1.2 1999/09/23 20:02:58 pbrown Exp $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# This work is derived from:
#       TheNextLevel
#       Copyright 1996 By Greg J. Badros <gjb@cs.duke.edu>
# distributed under GNU General Public License.
#
divert

TraceForErrors(`Xlock/Screensaver menus...')

define(`AddXLockOption',`*XLockChoice	Option $1 off "capitalize($1)"')

*XLockWarpPointer
*XLockFont 		MEDIUM_FONT
*XLockButtonFont 	BASIC_FONT-bold-r-*-120-*
*XLockInputFont 	MEDIUM_FONT
*XLockFore 		WINFORE_COLOR
*XLockBack 		MENUBACK_COLOR
*XLockItemFore 		WINFORE_COLOR
*XLockItemBack 		WINBACK_COLOR
*XLockLine 		center
*XLockText 		"Available Xlock modes"
*XLockSelection		Option single

esyscmd(`xlock -help 2>&1 | awk "BEGIN{item = 0} \
                /^$/ {next} \
                /one of:/ {ok=1; next} \
                /^[ \t]*[a-m]/ && ok==1 \
                { \
                  if (/random/) { next }; \
                  if (item == 0) { print \"*XLock1Line  expand\" }; \
                  printf(\"AddXLock1Option(%-10s)\\n\", \$1) ; \
                  item = (item+1)%5 ; \
                }"')
# We add the random thing separately, to be sure that we have at least one
# selected option
*XLock1Choice    Option random  on      "Random    "

*XLock1Line     expand
*XLock1Line     expand
*XLock1Line     expand

*XLock1Button   quit "Screen Saver"
*XLock1Command  Exec xlock -nice NICELEVEL -erasemode no_fade -mode $(Option) -nolock
# somebody is gonna hate me for this one... :-)
*XLock1Button   quit "Background"
*XLock1Command  Exec xlock -nice NICELEVEL -erasemode no_fade -mode $(Option) -nolock -inroot
*XLock1Button   quit "Lock Screen"
*XLock1Command  Exec xlock -nice NICELEVEL -erasemode no_fade -mode $(Option)
*XLock1Button   quit "Cancel" ^[
*XLock1Command  Nop

##############################################################################

TraceForErrors(`Xlock/Screensaver menus part 2...')

define(`AddXLock2Option',`*XLock2Choice Option $1 off
"capitalize($1)"')

*XLock2WarpPointer
*XLock2Font             MEDIUM_FONT
*XLock2ButtonFont       BASIC_FONT-bold-r-*-120-*
*XLock2InputFont        MEDIUM_FONT
*XLock2Fore             WINFORE_COLOR
*XLock2Back             MENUBACK_COLOR
*XLock2ItemFore         WINFORE_COLOR
*XLock2ItemBack         WINBACK_COLOR
*XLock2Line             center
*XLock2Text             "Available Xlock modes"
*XLock2Selection        Option single

esyscmd(`xlock -help 2>&1 | awk "BEGIN{item = 0} \
                /^$/ {next} \
                /one of:/ {ok=1; next} \
                /^[ \t]*[n-z]/ && ok==1 \
                { \
                  if (/random/) { next }; \
                  if (item == 0) { print \"*XLock2Line  expand\" }; \
                  printf(\"AddXLock2Option(%-10s)\\n\", \$1) ; \
                  item = (item+1)%5 ; \
                }"')
# We add the random thing separately, to be sure that we have at least one
# selected option
*XLock2Choice    Option random  on      "Random    "

*XLock2Line     expand
*XLock2Line     expand
*XLock2Line     expand

*XLock2Button   quit "Screen Saver"
*XLock2Command  Exec xlock -nice NICELEVEL -erasemode no_fade -mode $(Option) -nolock
# somebody is gonna hate me for this one... :-)
*XLock2Button   quit "Background"
*XLock2Command  Exec xlock -nice NICELEVEL -erasemode no_fade -mode $(Option) -nolock -inroot
*XLock2Button   quit "Lock Screen"
*XLock2Command  Exec xlock -nice NICELEVEL -erasemode no_fade -mode $(Option)
*XLock2Button   quit "Cancel" ^[
*XLock2Command  Nop

##############################################################################

AddToMenu StartMenu
+ "Lock Screen / Screen Saver (first half) MiniTitleIcon(lock)" FvwmForm XLock1
+ "Lock Screen / Screen Saver (second half) MiniTitleIcon(lock)" FvwmForm XLock2
+ "" Nop
