Find the answer to your Linux question:
Results 1 to 2 of 2
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2006
    Posts
    4

    xscreensaver


    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...

    Code:
    #!/bin/sh
    xrandr -s 640x480
    wine $HOME/.wine/drive_c/windows/SCRANTIC.SCR /s
    xrandr -s 1024x768
    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?

    thanks

  2. #2
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,294
    Hi, arewhyainn.

    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
    Code:
    #!/bin/sh
    
    # @(#) 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.
    sleep 10
    echo " We will never see this message for a ^C, kill, etc.."
    Running, and, within 10 seconds using interrupt (control-C, ^C) yields:
    Code:
    % ./s1
    Hello, world.
     Goodnight, Chet.
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •