This book explains how some aspects of ROX work.
If your question isn't ROX-related (ie, if switching to GNOME or KDE wouldn't make any difference) then try these links:
This document details the application directory system, as used in the ROX desktop. Comments are welcome. Programmers writing programs which have nothing to do with the ROX Desktop are still encouraged to consider using this system.
Normally, Unix programs are installed by running a script (possibly inside a Makefile or RPM package) as root. This script scatters files over the filesystem (hopefully without breaking anything). If you're lucky, you may get the option of uninstalling afterwards. It might even work!
Installing programs with this scheme usually requires root access, or a lot of trouble. Sometimes both.
Application directories are self contained applications. The directory contains the program's help files, images, binaries and possibly other things. They may still depend on other libraries, though.
An application directory does not normally need an installer - you can just move it wherever you want. You can `uninstall' an application by deleting the directory. You can run an application directory by clicking on it.
First, I'd like to make a few points clear:
You might also like to read:
ROX-Filer manual chapter on application directories.
Freshmeat article about them.
tutorial on creating a simple ROX application.
I am not clueless on the design of GoboLinux (most of the points apply to application directories too).Wrappers are tiny application directories which just run an already-installed version of the program. This is useful when you have a lot of non-application-directory packaged software installed already.
See
Peter Geer's Wrappers page and
the ROX-Wrap project for details.
However, note that ROX-Filer now supports freedesktop.org .desktop files. You can often find these in /usr/share/applications or some similar location.
The simplest case is something like tgif where you just have an executable and a help file.
The steps would then be:
You should be able to run the application now by clicking on it, copy it to another machine by copying the directory, etc.
For something like Vim with resource files the steps are similar, but put the resources (vim-runtime) into a subdirectory and make the AppRun a shell script that sets the VIMRUNTIME environment variable and runs the binary, eg:
#!/bin/sh APP_DIR=`dirname $0` APP_DIR=`cd "$APP_DIR";pwd` VIMRUNTIME="$APP_DIR/runtime"; export VIMRUNTIME exec "$APP_DIR/Vim" "$@"
For applications which have the pathnames of their resources hard-coded you will need to edit the source code. This guide shows how:
Guide to Making Relocatable Applications (autopackage.org)LibDirs are a special case of application directories. They are implemented the same but their use differs in two ways:
They are mainly used to provide libraries:
but can also used to provide other resources:
slashpackage."Changing the current system to application directories seems like a big change. It also destroys much of the 'old' systems' advantages like automatic updates and dependancy handling, because the packaging systems don't know where you dropped your application directory."
Plain AppDirs do make automatic updates difficult. However, even if you get a package manager to place them in a central directory it's still worth-while keeping each download in its own directory. It prevents conflicts between packages and makes uninstall easier. This is what AddApp does, although this does mean that deleting a launcher doesn't remove the application (instead, you need a cache cleaner similar to APT's deborphan to work out what is no longer required).
"It seems like a great idea, but I'm sure some people have doubts (just as I do right now) as in how to integrate it with current systems. So: How can I integrate existing apps in /usr/bin etc. into Rox? Do I have to create links, or can I create menus, etc?" -- Jens Benecke
You can link executables in /usr/bin to your Apps directory or panel (or run them in place), but you'll have to add the icons manually. A better way is to use the .desktop files usually found in /usr/share/applications; that way they have an icon and a tooltip too.
~/Choices was the old default location for configuration files in ROX. Now, most programs' settings are stored in the (hidden) ~/.config directory, and under Choices you will just find links to the new locations.
Settings are now namespaced to avoid conflicts. So, ~/Choices/ROX-Filer/Options became ~/.config/rox.sourceforge.net/ROX-Filer/Options.
Use the filer's Display menu to show hidden directories, or type /.config in your home directory's window to go straight to it.
This change brings ROX into line with the freedesktop.org base directory spec. See the specification for more information about what you can do with this system.
ROX-Lib provides a couple of modules to help you handle configuration. See the Options tutorial for more information.
ROX uses a hierarchical approach to the base directories. Inside the base directory itself is a directory for each source of applications inside which is a directory for each distinct application, plus directories for Shared configuration. For example ROX-Filer uses .../rox.sourceforge.net/ROX-Filer to store its configuration. Here rox.sourceforge.net refers to the source of the application and ROX-Filer the application.
The convention is to use an internet domain name under the control of the authors for the source, thus ensuring that it will be unique. If an author does not have such a domain then a contact email address for the author should be suitable.
As well as the private configuration data stored in the Configuration settings there is some shared configuration available for many applications.
rox.sourceforge.net/MIME-thumb/media_subtype /path/to/input/file /path/to/output/file size-in-pixels
How does the filer decide what icon to show for a file, and which program to use to open it?
For each file, the filer starts by working out its MIME-Type, as follows:
Do not edit the globs and magic files directly, as they are generated from some XML files by the update-mime-database command. If the filer isn't getting the right type for a file, you can use MIME-Editor to change the rules.
Having decided on the type, the filer now finds an icon using the freedesktop.org Icon spec. By default, this results in loading an icon from ~/.icons/ROX. You can also override the icons using the filer's Set Icon... menu item. See the Theming page for details.
ROX-Filer looks in your ~/.config/rox.sourceforge.net/MIME-types directory, and tries to run the program with the same name as the MIME type. The easiest way to set a type is by choosing Set Run Action from the menu.
If no program is found various fallbacks are tried: just the first part of the MIME type, and some other configuration directories. See the freedesktop.org basedir spec for details.
When you run a launcher from the ROX-All package, or a launcher created by AddApp, you are just executing a small script of the form (for ROX-Filer, in this example):
0launch http://rox.sourceforge.net/2005/interfaces/ROX-Filer
What does this do?
Ignoring the cache for now, it downloads the named resource from the web (you can view it in your browser if you want). This file lists all available versions of ROX-Filer. For each one, it says where it can be downloaded. The 0launch command prompts you to pick one (the default is the newest one), downloads it and runs it.