Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.6: Run 32-bit screen savers in the background in 10.6' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Run 32-bit screen savers in the background in 10.6
Authored by: RossGGG on Feb 17, '10 04:32:36AM
I modified this hint to make 32-bit screen savers run as the normal system screen saver in 10.6. Now I can use Fenetres Volantes again!! Basically, I wrote a script to check how long the computer had been idle, then run the screensaver terminal command, without the '-background' option, if the computer had been idle over a certain amount of time. Then I created a launchd plist to run the script every 90 seconds.

Here's how I did it:

1. Launch system preferences in 32-bit mode and assign a 32-bit screen saver
2. Make sure the delay to start the screen saver is set to "Never"
3. Make a file called scr32.sh and paste the following code in it. (Change the IDLE_WAIT_TIME variable from 900 to desired screen saver delay time)

/usr/bin/scr32.sh
#!/bin/sh

IDLE_WAIT_TIME=300 #Number of seconds to wait before starting screen saver

IDLE_TIME=$(ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print int($NF/1000000000); exit}')
SCREENSAVER_RUNNING=`ps ax | grep ScreenSaverEngine | grep -v grep | cut -c1-5 | paste -s -`

if [ "$SCREENSAVER_RUNNING" ]; then
     exit 0
else
     if [ $IDLE_TIME -gt $IDLE_WAIT_TIME ]; then
          arch -i386 /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine
     fi
     exit 0
fi

4. Save the file to the folder /usr/bin/
5. Make a file called com.GibsonTech.run32ScreenSaver.plist and paste the following code in it. (If you plan on having the screensaver start after less than 60 seconds of inactivity, you might want to change the StartInterval key here to something more appropriate for your needs)

~/Library/LaunchAgents/com.GibsonTech.run32ScreenSaver.plist
     <?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
          "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
     <plist version="1.0">
     <dict>
          <key>Disabled</key>
          <false/>
          <key>Label</key>
          <string>com.GibsonTech.run32ScreenSaver</string>
          <key>ProgramArguments</key>
          <array>
               <string>/usr/bin/scr32.sh</string>
          </array>
          <key>StartInterval</key>
          <integer>60</integer>
          <key>RunAtLoad</key>
          <false/>
     </dict>
     </plist>


6. Save the file to the folder ~/Library/LaunchAgents/

7. Run the following lines of code in Terminal and enter an administrator password when required
sudo chmod +x /usr/bin/scr32.sh

launchctl load ~/Library/LaunchAgents/com.GibsonTech.run32ScreenSaver.plist

That's about it. It currently only works for the active user. There are other places you can put the launchd plist to make it apply to all users, but if other users have a different screen saver configured this would probably screw it up.

[ Reply to This | # ]
10.6: Run 32-bit screen savers in the background in 10.6
Authored by: V.K. on Feb 17, '10 09:31:32AM
this is too complicated. you can just change the unix executable in the screensaver.app. rename the current one
cd /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine
sudo mv ScreenSaverEngine ScreenSaverEngine-old

Then replace the old /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine executable with an executable
#!/bin/sh
arch -i386 /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine32-old

Then you don't need any separate launch daemons or a separate mechanism to control the screensaver timer.

[ Reply to This | # ]
10.6: Run 32-bit screen savers in the background in 10.6
Authored by: RossGGG on Feb 17, '10 10:29:07AM

That's great and way more simple! I knew there had to be a better way to do this, but no one seemed to have provided one yet. Thanks!



[ Reply to This | # ]
10.6: Run 32-bit screen savers in the background in 10.6
Authored by: Ynot on May 07, '10 01:00:17PM

Can someone help me out with this hint? Where do I enter the code above? In Terminal? I tried it and it does not work for me.

Thanks



[ Reply to This | # ]
10.6: Run 32-bit screen savers in the background in 10.6
Authored by: slippyd on May 17, '10 06:58:14PM

I noticed as well that V.K.'s solution doesn't work. Here's a fixed version:

$ sudo bash
Password:
$ cd /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app/Contents/MacOS/
$ mv ScreenSaverEngine ScreenSaverEngine-executable
$ cat > ScreenSaverEngine
#!/bin/sh
arch -i386 /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine-executable
^d
$ chmod 755 ScreenSaverEngine
$ ^d

Note that bold text is what you'll type and ^d is code for “control-D”. Best of luck!



[ Reply to This | # ]