Selector - A File Frontend for GP2X

GP2X_front_small screenshot GP2X_small.png
News - How it works - Info & Download

Selector is a GP2X program which helps to launch other programs that need as a parameter the path to a file (for example, the first beta versions of GNUBoy2X), or to pass command line options (for example, to load a quake MOD).

In order to use Selector, three files are needed:

1. selector. This is the program that does all the job.

2. A configuration file. Keep on reading to understand its format.

3. A launch script which calls selector telling it where is the configuration file and afterwards launchs the main menu of GP2X. Keep on reading to see an example.

Configuration file

The configuration file is a text file with UNIX line-endings (not MS-DOS/Windows).

Each line of the configuration file can be in one of the following formats:

-(Optional) All lines preceded by # are considered as comments and will be ignored.

-(Optional) A line starting with the keyword langCode= followed by a language code (actually only EN for  English, TR for Turkish and ES for Spanish are valid language codes). Default value is Spanish.

-(Optional) A line starting with the keyword skinPath= followed by a path. The program will look in the directory defined by the path for a PNG image file named fondo.PNG, which must have a size of 320x240 pixels, and use it as Background for the interface. There are some examples in the Skins folder. Default value is no skin (green background).

-(Optional) A line starting with the keyword layoutCode= followed by a number, which indicates a layout number for the interface elements. At the moment there are two options;
0, where the screen is updated with a copyright message at the top, followed by the actual command line selected, and a help message at the bottom of  the screen.
1, with no copyright message, and the bottom help message is substituted by the command line selected.

-(Optional) A line starting with the keyword scrollWrap= followed by a number, which indicates if scroll wrapping should be active or not. The default is scroll wrap active. At the moment there are two options;
0, no scroll wrap.
1, scroll wrap active.

-(Optional) A line starting with the keyword doubleColumn= followed by a number, which indicates if two columns file listing should be active, instead of the default single column view. At the moment there are two options;
0, Single Column View.
1, Two Columns View.

-(Optional) A line starting with the keyword selectRectangle= followed by a number, which indicates the kind of selection rectangle to use in the interface. At the moment there are two options;
0, no selection rectangle.
1, green selection rectangle.

-(Mandatory) A line (or lines) starting with the keyword cmdLine= followed to the path to an executable GP2X file, including
all the desired parameters. Each of this lines will be an option to launch from the selector.

-(Mandatory) A line starting with the keyword baseDir= followed with the path to the directory which will be taken as base for the program file interface. Uppon starting selector, it will display the directories and files filtered inside this directory, and will allow to navigate through it and its subdirectories
but not through upper directories.

-(Optional) A line (or lines) starting with the keyword fileFilter= followed by one file extension which will be used as a filter when showing files. If there was no line with this keyword, selector will  display all the files in the directories.

Once configured, after launching, it will appear a file selection interface where you can navigate using the joystick, and choose a file using B, X, Select or the joystick button.
A and Y buttons let you select different command line options (useful to launch, for example, Quake with different startup options, or gnuboy2x with different sound qualities of disabling it).
L and R buttons are used to navigate faster (screen by screen).

Execution Script

As selector needs as a parameter the name of its configuration file, a shell  script is needed to launch it as well as, if necessary, to launch back the GP2X main menu.

This is a simple example script:


./selector ./gnuboy_config

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

Now copying this script into a directory of your SD card, along with selector and a configuration file named gnuboy_config, it would launch selector with that configuration, sync the SD card after exit, and launch again the GP2X main menu.

It is important to remember that the script file is a text file with UNIX line-endings (not MS-DOS/Windows) and that it must have .gpe extension.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Copyright (c)  2006  kounch.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.

The product names used in this web site are for identification purposes only. All trademarks and registered trademarks are the property of their respective owners. Logo Support This Project Valid HTML 4.01!