Getting xPL Perl Running
You can download xPL Perl from its trac site. Download the tar.gz file. You can also download a PDF documentation about the scripts and the libraries.
As you are in the download phase, take the opportunity to fetch the Device Configuration Manager (DCM) from the xPL4Java site.
You will need the Apple xCode tools to run the
Install them from the Mac OS X install CD.
On the desktop, create the folder
xPL and move your downloads into that folder.
cd ~/Desktop/xPL/ tar -xvf xPL-Perl-*.tar.gz cd xPL-Perl-* perl Makefile.PL
At this point you might see warnings telling that one or more Perl modules are missing. Install them using the standard CPAN method.
For example, if you have the message:
Warning: prerequisite Date::Parse 0 not found.
You should run:
sudo perl -MCPAN -e 'install Date::Parse'
Once you have no more warning, continue the xPL-Perl installation:
make make test sudo make install tar -xvf DCM.tgz
With this, you have the Perl scripts located in
or in in
and the Device Configuration Manager in
You might want to move this last one to some more convenient place such as
If you plan to use
xpl-dawndusk which sends dawn and dusk
you will have to install the Perl
sudo perl -MCPAN -e 'install DateTime::Event::Sunrise'
Let's test the current scripts.
The very first thing we need in an xPL system is a hub.
There should be a single one in you local network, so turn any other one off.
Launch it in the
The -v (verbose) option will show you any discovered or removed xPL client.
Open a second
Terminal window and
As you can imagine, the logger will display all the xPL messages forwarded by the hub.
Open a third
Terminal window and
xpl-clock -v --tick_interval 5
The xpl-logger should show the clock tick messages every 5 seconds, and other ones such as its own heart beats.
The xpl-hub should show the xPL applications:
If you quit these, xpl-hub will reflect the changes after some time.
DCM.jar and check if you see the
You can also have a look at the log tab.
Start xPL at boot
Mac OS X defines 2 ways of launching daemons:
- with Mac OS X v10.3 and earlier, you must use
- from Mac OS X v10.4, the preferred method is to use
Why not use the most recent technique?
Having the necessary privileges, create the Launchd Property List File
/Library/LaunchDaemons/xPL.plist with the following contents:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>xPL</string> <key>UserName</key> <string>control</string> <key>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/usr/local/bin/xpl-hub</string> </array> <key>SHAuthorizationRight</key> <string>system.preferences</string> </dict> </plist>
Here the username has been given as
I have created this user with limited privileges.
Replace the name with any other existing user's.
Reboot the Mac and check if xpl-hub is running:
ps ax | grep hub | grep -v grep
or, as root:
launchctl list | grep xPL
Restart the daemon with:
launchctl stop xPL
Stop the daemon with:
launchctl remove xPL
Start the daemon with:
launchctl load /Library/LaunchDaemons/xPL.plist