epoch1970;347385 Wrote: 
> David,
> 
> Having a mac as my desktop I checked and it looks like there is a weird
> escaping/unescaping problem with the double quotes or single quotes in
> the command.
> So I wrote a wrapper, that should probably be an applescript but I know
> even less AS than shell. I dropped it in my homedir, made sure it was
> executable :
> - open Terminal.app
> - type without the quotes, watch for the final space: "sudo chmod +x
> "
> - drag the script icon to the window, its path will complete the
> command
> - hit return
> (now if you cmd-i on the icon it should say "unix executable" or
> somesuch.)
> 
> You can try from terminal.app, if the mac won't budge the file is
> probably not executable. Assuming you've not renamed the file and it is
> in your homedir: 
> "/Users/me/srvPowerControl_MacOSX.sh suspend" without quotes, replacing
> "me" by your login, followed by return, should put your mac to sleep.
> 
> Then I entered prefs in Squeezecenter for the plugin:
> - for Suspend (without quotes, replace "me" by your login):
> "/Users/me/srvPowerControl_MacOSX.sh suspend"
> - for Shutdown (without quotes, replace "me" by your login):
> "/Users/me/srvPowerControl_MacOSX.sh shutdown"
> - for Restart (without quotes, replace "me" by your login):
> "/Users/me/srvPowerControl_MacOSX.sh restart"
> 
> It worked for me on mac mini Intel 10.5.5... except that my SB doesn't
> seem to be able to WOL the mac :( Works so well usually. Maybe it is a
> version mismatch, I have SC 7.2 on the mac and most often use SC 7.2.1
> on linux.
> 
> Please tell Gordon how this works for you, perhaps he'll want to
> include the snippet in his package.
> 
> This is the contents of the attached file:> 
Code:
--------------------
  >   > #!/bin/sh -e
  > case "$1" in
  >     "suspend")
  >     /usr/bin/osascript -e 'tell application "System Events" to sleep'
  >     exit
  >     ;;
  >     "shutdown")
  >     /usr/bin/osascript -e 'tell application "System Events" to shut down'
  >     exit
  >     ;;
  >     "restart")
  >     /usr/bin/osascript -e 'tell application "System Events" to restart'
  >     exit
  >     ;;
  >     *)
  > echo "Unknown command $1. Try suspend, shutdown or restart."
  > ;;
  > esac
  > exit
  > 
--------------------
> > 
> 
> HTH

Hi Epoch,

Just to let you know - works great.  Thanks very much for your help. 
This plug in is really useful.

David

SB3 > Lavry DA10 > Cyrus 8VS > Acapella SE (Troels Gravesen design)
SB3 > Leak Stereo 20 (V Old) > Mission 760iSE
Squeezebox Boom


-- 
DaveWr
------------------------------------------------------------------------
DaveWr's Profile: http://forums.slimdevices.com/member.php?userid=9331
View this thread: http://forums.slimdevices.com/showthread.php?t=48521

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to