|
|
timkered script
i tinkered with foons script and then i started again!
heres a new version - comments welcome, bug fixes etc
theres usage info and a few comments, works pretty much the
same, you can choose a few more options.
i keep my stuff in /usr/local/bin . call it what you like. cheers...
--cut here--
#!/bin/sh
# above line specifies which shell to useto execute this file
# author: rob stone. psychology, university of york, uk. modified by
# idea from foon (Joel Kraut) on mscosxhints see
# http://www.macosxhints.com/article.php?story=20020830050630964
#set -x
#debugging switch - uncomment to see what is happening
#shell variables set in one place for ease
PATH=/bin:/sbin:/usr/bin:/usr/sbin # set to make sure nothing odd gets run
SAVER="/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine "
USER=`users`
NICE="nice -n 20 " # run at a lower priority so as to free up resources
BKG=0 # set to 1 if you always wnat this and you can alter the behaviour of -b
SWITCHES=" -background " # set to run in the background,
function usage () {
# show the usage info with the options
PROGNAME=`basename $0` ;
echo "Usage: $0 [-d|-h|-k|-l] [-b] [-f] [-r|-m modname]"
echo " $PROGNAME use currently chosen module"
echo " $PROGNAME -b background the task (&) and return control to terminal"
echo " $PROGNAME -d display all the running screensaver modules and exit"
echo " $PROGNAME -f display in the foreground - funky"
echo " $PROGNAME -h show this help screen and exit"
echo " $PROGNAME -k kill all the running screensavers and exit"
echo " $PROGNAME -l list available modules for $USER and system and exit"
echo " $PROGNAME -m modname use module Modname"
echo " $PROGNAME -r use the Random module"
echo
echo "Note: specifing more than one -r or -m will use the last one listed"
echo
exit 0
}
function killsavers() {
# get the ps lines for very occurence the pid is the first 5 chars
for ID in `ps -c | fgrep "ScreenSaverEn" | cut -c1-5 `
do
kill $ID
done
}
# loop around the flags processong each one.
while [ $# != 0 ]
do
case $1 in
-b) BKG=1
shift
;;
-d) ps -c | fgrep "ScreenSaver"
exit 0
;;
-f) SWITCHES=" -foreground "
shift
;;
-l) echo "==== USER $USER [ /Users/$USER/Library/Screen Savers] ======"
ls /Users/$USER/Library/Screen Savers/ | fgrep .saver
echo "==== SYSTEM [/Library/Screen Savers/] ======"
ls /Library/Screen Savers/ | fgrep .saver
exit 0
;;
-k) killsavers
exit 0
;;
-r) SWITCHES="$SWITCHES -module Random"
shift
;;
-m) SWITCHES="$SWITCHES -module $2"
shift
shift
;;
*) usage
;;
esac
done
killsavers
case $BKG in
1) $NICE $SAVER $SWITCHES & ;;
*) exec $NICE $SAVER $SWITCHES ;;
esac
-- cut here --
apologies for the double line spacing - dont know whats happening there !
cpu monitor as desktop
i'm not a programmer, but i was wondering if screensavers were a type of app? the reason i'm wondering is that i want to run cpu monitor (or equivilent) as my desktop. I know it sounds useless, but i love leaving it running (expanded view) large to see my computer "think"(silly I know) but it floats above my desktop icons... is there a way to make a screensaver get the information on cpu usage and display an active graph? i'm thinking a screensaver to desktop method would be the only way to get this to work... Am i way off and just dreaming?
timkered script
Just an update for using this script with Tiger. But it also enhances it's use under Panther. Adding following extra lines includes support for .slideSaver and .qtz (quart composer things) screen savers. Also by adding the "/System/Library/Screen Savers" directory, you will then be able to call each of the pre-installed screen saver modules as well. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.10 seconds |
|