I was working on a similar approach, though not as elegant as
O’rillymj's.  This is what I’ve come up with so far: (please forgive
the overly wordy and didactic post.)

If your system running SlimServer is more or less dedicated to that
task (i.e. you don’t use it for “real work”) then try the following:

Essentially, you’ll disable system standby and system hibernation in
the windows power options and instead put the slimserver in charge of
putting your windows box to sleep.  

Start by disabling system standby and system hibernation on the windows
machine.

Then, download the free pstools suite from www.sysinternals.com.  Copy
psshutdown.exe to your C:\Program Files\Slimserver\server\Plugins
directory.

Download Jason Holtzapple’s PowerSave.pm plug-in from
http://ultratrendy.com:31888/slim/ and copy it into the Plugins
directory.

With slimserver not running (kill the service or kill perl.exe,) open
PowerSave.pm with Wordpad and look for the line towards the bottom that
reads:

Code:
--------------------
    
  Slim::Control::Command::execute ($client, ['power', 0]);
--------------------


Now, immediately  below that line, add the following:


Code:
--------------------
    
  #start to shutdown the slimserver box
  system("\"C:\\Program Files\\SlimServer\\server\\Plugins\\psshutdown.exe\" -c 
-d -m \"Slimserver Suspending this computer!\" -t 120\"");
--------------------

Now, start up Slimserver and enable the PowerSave plugin.

At the SqueezeBox, using the remote, scroll down to plugins, select the
PowerSave plugin, set it to ON, and select the time out value.

Now, 15 minutes, 2 hours, (or whatever you set the plugin timeout to)
after the SqueezeBox quits playing, the PowerSave plugin will turn off
the SqueezeBox and run psshutdown.exe on the Slimserver box.  With the
parameters set above, the Slimserver box will go into suspend mode
after a two minute warning.  You can cancel the suspension by clicking
on the psshutdown dialog cancel button.

If you do use your slimserver box for “real work,”  then having that
dialog box pop up in your face might be kind of annoying.  Here’s
another, more subtle approach:

Again, edit PowerSave.pm with WordPad, and substitute this line for the
line you added before:

Code:
--------------------
    
  system("cmd.exe /c \"C:\\Program 
Files\\SlimServer\\server\\Plugins\\suspendnow.cmd\"");
--------------------


Now, create two batch files, again in the Plugins directory:

suspendnow.cmd:

Code:
--------------------
    
  @echo off
  schtasks /DELETE /s \\slimserver /u usernamd /p password /TN SlimSleep /F
  schtasks /create /s \\slimserver /u username /P password /sc ONIDLE /I 10 /tn 
SlimSleep /tr "%Comspec% /c \"%~dp0suspend_wake.cmd\""
--------------------


This 1st batch file uses the schtasks.exe command which is part of
Windows XP.  You’ll need to substitute the computer network name of
your slimserver box for the "\\slimserver" entry, and substitute a
valid username and password for a user with administrative privileges
on the system.

This batch file simply tries to delete the "SlimSleep" scheduled task,
if one exists.  It then creates the SlimSleep task and schedules it to
fire off after the next 10 minute idle period (no mouse or keyboard
activity.)  You can increase that idle timeout to whatever you
want…just change the "/I 10" entry to "/I 45" or whatever.  

Next, create the 2nd batch file:

suspend_wake.cmd:

Code:
--------------------
    
  @echo off
  start "Suspending" "%~dp0psshutdown.exe" -c -d -m "Slimserver Suspending this 
computer!" -t 120
  echo Sleeping for 5 seconds..
  sleep 5
  schtasks /DELETE /s \\slimserver /u username /p password /TN SlimSleep /F
--------------------

This batch file gets invoked by the scheduled task, fires off
psshutdown.exe to start the suspend countdown, and finally deletes the
task that invoked it.

There.  That’s two ways to put Slimserver and your SqueezeBox in charge
of power savings on your computer.


-- 
gharris999
_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/beta

Reply via email to