danco;468172 Wrote: 
> I finally got SvrPowerControl working on my Mac. It was difficult
> because of odd permissions issues with SqueezeCenter, which I will ask
> about elsewhere.
> 
> I see that one can really assign any scripts to the menu options.
> 
> Is it possible (and fairly easy!) to change menu item names? If I am
> running a script on Shutdown Server I would really like the menu item
> name to give an indication of the actual script.
> 
> Also, though this may be much harder, is it possible to add extra
> scripts to the menu?

The first request is really easy. Look at SrvrPowerCtrl's strings.txt
file, find the appropriate string, and change it.

The second one would be a little more difficult, but you'll learn a
little perl syntax in the process: add an new custom "action" to the
array of actions assembled in sub initActionItems in Menu.pm.  It might
look something like this:


Code:
--------------------
    
        push ( @{$g{aActions}},
                                {       action                                  
=> 'my_unique_action_id',
                                        actionid                                
=> 0x00040000,
                                        menuindex                               
=> $menuindex++,
                                        menutext                                
=> "My Action Name",
                                        message                                 
=> "My Action Message",
                                        dispblock                               
=> 0,
                                        getcommandargcoderef    => undef,
                                        poweroffplayers                 => 
$g{prefs}->bPowerOffPlayers,
                                        gotosn                                  
=> 0,
                                        checkblock                              
=> 1,
                                        cancelwait                              
=> $g{prefs}->nRegretDelay,
                                        cmdwait                                 
=> 5,
                                        refreshwait                             
=> -1,
                                        stopsc                                  
=> 0,
                                        setrtcwakeup                    => 0,
                                        command                                 
=> "sudo path_to_some_script.sh" },
        );
  
  
--------------------

That new command will be "hard coded" into the plugin now and won't be
modifiable via the settings page.  But that's ok.  Adding a new command
AND the settings support is five times harder.

Remember, you'll need to restart SC/SBS to see any changes you make to
the strings or code.

I've often thought that if KDF really abandons his ground-breaking
ExecuteScript plugin, then it might make sense to redo SrvrPowerCtrl
with an xml interface so that these sorts of modifications would be easy
to accomplish and not require editing the actual plugin code.


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

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to