Guide: Xulrunner Apps On The Pandora


mindlord

Notices Two Things
Joined
Mar 10, 2006
Messages
1,790
Location
In a cave.
Website
Visit site
Since Firefox 3, there exists a way to run XUL based applications without needing a separate XUL runtime. I've been using the XUL Runner version of SQLLite Manager using this method, and it really helps keeping Firefox lithe and frisky on the Pandora by not having to install it as a Add-On.

I've tried in vain to get this working using the PND version of Firefox, and sadly I cannot get it to work, no matter which way. If someone more clever than myself can figure that out, good on you! It could also be possible to create a XUL Runner PND, but I'm too lazy.

If you want to run XULrunner applications on the Pandora here's how:

Firstly, you'll be installing things to the NAND, so if you're a purist you may not want to do it this way if you can help it. I personally run my OS from an SD Card, so I'm not too concerned with installing .ipks.

Install Firefox:
Code:
sudo opkg update
sudo opkg install firefox libsqlite3-0

Download some XULRunner applications:
XUL Hall of Fame
I'm looking for other sites that have XULrunner based apps too if anyone knows of them

Unpack the XULRunner app to your SD card, and make note of where you placed it. In my case SQLite Manager which I unpacked to:
Code:
/media/Pand32G/XUL apps/SQLite/

All XULRunner apps have a file called application.ini in their root that contains all the necessary settings to launch the program using firefox. Let's try it out.

- From a Terminal -
Navigate to the XUL application's folder:
Code:
cd /media/Pand32G/XUL apps/SQLite/
and use the freshly installed firefox to launch the application:
Code:
firefox -app application.ini
XULRunner takes some time to fire up, but your XUL application should start running shortly.
That's about as pie as it can get from the Terminal.

- From the Desktop -
So, we've established that this works, so how do we make it easier? We could create a Launcher on the desktop for the application, or we could create a menu entry that can launch XUL application ini's. Let's make a Launcher first.

*** Note: By default your desktop is owned by root. You need to give yourself ownership to make launchers directly on the desktop. If you haven't done so already you should really do it now anyways even if you're not really following this guide.
Code:
sudo chown USERID:USERID /home/USERID/Desktop
We will need a shell script to launch XUL applications
You can create this in the /usr/bin directory or if you're like me I keep my personal scripts elsewhere. Being unfraid of putting things in my /usr/bin folder, I'll put mine there.

Code:
sudo mousepad /usr/bin/xullauncher
Copy and paste this into mousepad - xullauncher script:
Code:
#!/bin/sh
cd "$1"
firefox -app application.ini

Now we have to give ourselves permission to run the script
Code:
sudo chmod 775 /usr/bin/xullauncher

Right click the Desktop and choose "Create Launcher"
Give the Launcher a name I chose: SQLite Manager
and fill in the command line:
Code:
xullauncher '/media/Pand32G/XUL apps/SQLite/'
Take note how paths that contain spaces must be wrapped in quotes (')
Additionally if you placed xullauncher elsewhere you will need to include the full path to it.
Often times XULRunner applications will include icons in the package that you can use with your launcher.
You can copy the .desktop file that gets created to /usr/share/applications/ to have the icon appear in your menu as well.
Code:
sudo cp /home/USERID/Desktop/XULAPPLICATION.desktop  /usr/share/appplications/XULAPPLICATION.desktop
You may need to manually edit it with mousepad to set the categories unless you're okay with it appearing in "Other".

- From Thunar -
Create xullauncher just like for the Desktop launcher.
Open Thunar and click Edit -> Custom Actions
Click the Green Plus to add a new action
Name: Launch XUL Application
Command: xullauncher '%d'
Give it an icon if you want.
Click the Appearance Conditions tab.
File Pattern: application.ini
Check Text files and Other files.
Click OK.

- Closing -
Having easy access to XULRunner opens up several cool programs without the need for extra packaging. If you know of any cool XULRunner apps please post links to them here. I find this very handy, and I hope some of you do too.
 

skeezix

Internal Development
Joined
Mar 11, 2003
Messages
8,064
Website
www.codejedi.com
With corrects args to pnd_run.sh you can mount-only (no run anything) and later unmount, or mount and run as normal. Your runscript in your pnd can in turn mount or run the firefox pnd (until such time we build dependancy handling in)

Jeffphone
 

mindlord

Notices Two Things
Joined
Mar 10, 2006
Messages
1,790
Location
In a cave.
Website
Visit site
I've tried this, but it fails.
Code:
Error: Platform version '1.9.2.3' is not compatible with
minVersion >= 1.9.2.4
maxVersion <= 2.0.*
 

mindlord

Notices Two Things
Joined
Mar 10, 2006
Messages
1,790
Location
In a cave.
Website
Visit site
firefox -app application emits that error. I might be using a beta firefox PND or something. For me, the ipk is enough because I boot from SD anyways.
 
Top