3 # script - "xscreensaver.kss"
5 # Author: Shane Smit <shane_smit@calderasystems.com>
7 # Modification History:
8 # [08/23/1999] - Shane Smit: Creation
11 # This script file enables users to use XScreenSaver via the
12 # KDE Display Properties.
14 # Permission to use, copy, modify, distribute, and sell this software and its
15 # documentation for any purpose is hereby granted without fee, provided that
16 # the above copyright notice appear in all copies and that both that
17 # copyright notice and this permission notice appear in supporting
18 # documentation. No representations are made about the suitability of this
19 # software for any purpose. It is provided "as is" without express or
23 # Locking is turned off by default.
24 lockmode="-no-lock-mode"
27 exec_prefix="@exec_prefix@"
35 # This is the name in the list box.
41 # This simply runs xflame in the preview window. For this to be "real",
42 # it needs to run xscreensaver with a -window-id parameter for each hack.
43 # There are two ways to do this:
44 # 1) Hack xscreensaver to allow global parameters.
45 # 2) Hack xscreensaver to accept alternate setup files, and create one on
48 $hackdir/xflame -delay 1 -window-id $1 & # Start new preview
49 echo "$!" > $HOME/.kss-preview$1.pid.`hostname` # Write PID
50 wait $! # Wait for it to get killed
55 $bindir/xscreensaver -no-splash & # daemon must be started
56 $bindir/xscreensaver-demo # or the setup will produce
62 # I was unable to grep stdout because xscreensaver nabs it. But I was able
63 # to output it to a file, and grep the file.
64 TEMP_FILE=/tmp/xsc.$RANDOM
65 $bindir/xscreensaver -no-splash -verbose -no-capture-stderr 2> $TEMP_FILE &
66 $bindir/xscreensaver-command -activate
68 ExitNow=$(grep -E -c unblanking\|already $TEMP_FILE)
69 if [ $ExitNow != 0 ]; then
76 exit # It should never get this far.
80 # echo "Not yet supported"
90 if [ ! -f "/etc/shadow" ]; then
95 # echo "Not yet supported"
102 # echo "Not yet supported"
105 echo "Unknown parameter: $1"
111 if [ -n "$Install" ] ; then
112 PID_FILE=$HOME/.kss-install.pid.`hostname`
113 if [ -r "$PID_FILE" ] ; then
114 kill `cat $PID_FILE` # Kill old screensaver
116 echo "$$" > $PID_FILE # Write PID of this script
117 $bindir/xscreensaver -no-splash $timeout $lockmode $Nice & # Start XScreenSaver daemon
118 trap "kill $!" SIGTERM # Set these to kill the daemon
119 trap "kill $!" SIGKILL
121 # KDE sends SIGUSER1 to indicate the user has hit the "lock" button.
122 trap "$bindir/xscreensaver-command -lock" SIGUSR1
124 wait $! # Do not exit, just wait for signals.
127 echo "Usage: ./xscreensaver.kss -install|-setup|-test|-desc [-delay num] [-lock] [-nice num]"
128 # echo " -corners xxxx Placing cursor in corner performs action:"
129 # echo " x = i no action (ignore)"
130 # echo " x = s save screen"
131 # echo " x = l lock screen"
132 # echo " order: top-left, top-right, bottom-left, bottom-right"
133 echo " -delay num Amount of idle time before screen saver starts (default 10min)"
134 echo " -desc Print the screen saver's description to stdout"
135 echo " -install Install screen saver"
136 echo " -lock Require password to stop screen saver"
137 # echo " -allow-root Accept root password to unlock"
138 echo " -nice num Run with specified nice value"
139 echo " -preview wid Run in the specified XWindow"
140 # echo " -inroot Run in the root window"
141 echo " -setup Setup screen saver"
142 echo " -test Invoke the screen saver immediately"
145 # End of script - "xscreensaver.kss"