For the last 6 month I've completely moved to linux, I've used wine to use all the windows things I had to have. But there is still one thing I can't do and that is have my Johnny Castaway screen saver run at idle times like xscreensaver does. I've used this screensaver since I started using Windows 3.1 (when I was 7 or 8 ) so it has sentimental value to me. I've been messing around to see how xscreensaver (xss) works. and I found out that all the SS are just binaries/exeutables files that XSS executes.
I can run Johnnycastaway with xscreensaver, but the screensaver only has one resolution 640x480, and if it runs in another resolution then there is a black board around it. So, I have made me a shell script to run...
But when you hit the mouse or keyboard to stop xscreensaver just kills the script and the screen stays at 640x480, is there a setting I can put where it will complete the script and make XSS wait for the nexted Idle time period? Or any other Ideas you guys/gals can give me?
xrandr -s 640x480
wine $HOME/.wine/drive_c/windows/SCRANTIC.SCR /s
xrandr -s 1024x768
One way may be to use a trap to do something special when your script process receives a signal. I don't know what signal is being sent, but you can play with script below and read man bash (down around line 4500 on my CentOS system) to see the general flow of things. (If you leave the "0" signal in, you'll get the echo twice, because of the normal exit producing signal 0.) ... cheers, drl
Running, and, within 10 seconds using interrupt (control-C, ^C) yields:
# @(#) s1 Demonstrate trap.
# trap 'echo " Goodnight, Chet." ; exit 1' 0 1 2 15
trap 'echo " Goodnight, Chet." ; exit 1' 1 2 15
echo Hello, world.
echo " We will never see this message for a ^C, kill, etc.."