Copyright © 2008-2011 Oliver Hamann. Homepage: http://eaglemode.sourceforge.net/
The script files are located in the directory $EM_DIR/etc/emFileMan/Commands (replace $EM_DIR by the installation directory of Eagle Mode, and replace etc by etcw if on Windows). Commands of subgroups are located in corresponding subdirectories. You could modify the commands directly there, but this may require administrator privileges. Alternatively, you could create a copy of the whole directory tree, so that it is possible to modify the files with user privileges. The required path for that copy is $HOME/.eaglemode/emFileMan/Commands (or on Windows: %APPDATA%\eaglemode\emFileMan\Commands). If that directory exists and seems okay, the script files are loaded from there, and the other is ignored.
Adding a new command simply consists of adding a new script file. To make a change visible to Eagle Mode, trigger the button Reload Files. Error messages for bad script files are printed to STDERR, and therefore it is a good idea to run Eagle Mode from a terminal while working on the commands (exception: on Windows the messages are written to %TMP%\emCoreBasedAppLog.log).
Remember to make backups of your modifications, because they could be removed when reinstalling Eagle Mode.
Note: This document describes the UNIX version where the scripts are written in Perl. On Windows, everything is very similar, but the scripts are in Javascript.
# Order = 3.0
Simply set the order number to zero:
# Order = 0.0
Thereby, Kate gets precedence over all the other text editors. And besides, the button moves to the beginning of the group.
#!/usr/bin/perl #[[BEGIN PROPERTIES]] # Type = Command # Order = 0.0 # Interpreter = perl # DefaultFor = type # Caption = name #[[END PROPERTIES]] use strict; use warnings; BEGIN { require "$ENV{'EM_DIR'}/res/emFileMan/scripts/cmd-util.pl"; } OpenSingleTargetFileWith('program'); |
type | Replace this by the file type the application is able to handle. It must be a file name ending including the leading dot (something like .avi), or a colon-separated list of such (e.g. .avi:.mpg), or the special keyword file for the case the application is a plain text editor. |
name | Replace this by the application name. It is shown in the button. |
program | Replace this by the executable file name of the application, like it is called in a shell, with or without path. |
The format of the properties section is:
#[[BEGIN PROPERTIES]]
# name = value
# name = value
# name = value
...
#[[END PROPERTIES]]
Possible properties are:
Name | Description | ||||||
Type | Type of the element. Possible values are: Command - The file is a command script. Group - The file describes a command group. This property must always be there. |
||||||
Order | Order of the element. This can be any number. Within a group, the elements are sorted by these numbers. The element with the lowest number is at the beginning. | ||||||
Interpreter | This property is only for commands. It specifies the program to be called as the interpreter for the script. For Perl scripts, say perl. | ||||||
Directory | This property is only for groups, and there it is always required. It specifies the name (without path) of a subdirectory containing the elements of the group. | ||||||
DefaultFor | This property is only for commands. It specifies the file
types for which the command is a default command. The value for
this property must be one of:
|
||||||
Caption | A caption to be shown in the label of the button or group. | ||||||
Description or Descr |
A description to be shown in the label of the button or group. This property can be given multiple times for creating a multi-line description. | ||||||
Icon | An icon to be shown in the label of the button or group. It can be specified by a file name (without path) of a TGA file in the directory $EM_DIR/res/icons. | ||||||
BgColor FgColor ButtonBgColor ButtonFgColor |
Background and foreground colors of the borders and buttons. The colors of a group are used as the default for the elements of the group. A color can be specified as a color name like Powder Blue, or as a hexadecimal RGB value like #B0E0E6 or #BEE. | ||||||
Hotkey | This property specifies a hotkey for the command. Sample values are: Ctrl+C, Shift+Alt+D, Meta+F10 | ||||||
BorderScaling | Scale factor for the size of the border. The default is 1.0. Zero means to make a group panel unfocusable. | ||||||
PrefChildTallness | Preferred height/width ratio of the elements of the group. The default is 0.2. |
use strict;
use warnings;
BEGIN { require "$ENV{'EM_DIR'}/res/emFileMan/scripts/cmd-util.pl"; }
This loads and executes a framework which performs some initializations and defines a lot of of utility functions. For information about those functions, please have a look into the file $EM_DIR/res/emFileMan/scripts/cmd-util.pl, and take all the existing command scripts as usage examples.
The rest of this document may be of interest only for understanding the implementation of the framework, or for writing a new framework in another scripting language.
Name | Description |
EM_DIR | Directory where Eagle Mode has been installed. |
LD_LIBRARY_PATH | Contains $EM_DIR/lib, for that the libraries can be found. |
EM_FM_SERVER_NAME | Name of the file manager's emMiniIpc server. |
EM_COMMAND_RUN_ID | An identification for this run of a command. |
EM_X EM_Y EM_WIDTH EM_HEIGHT |
Position and size of the application window. This can be used to calculate a good position for popup dialogs. |
Next Reading: Advanced Configuration |