# External Editors

- The Geeqie User Manual
- Image Management

This section describes the external editor facility.

- 4.4.1. External Editing
- 4.4.2. External Editors
- 4.4.3. Result dialog
- 4.4.4. Editor Configuration

## 4.4.1. External Editing

Geeqie provides the ability to execute commands, such as running an image editor on a selected image. In Geeqie these are called the external editing commands.

## 4.4.2. External Editors

External editors can do anything from running simple operations like symlink to fully featured programs like gimp.

Geeqie looks for standard desktop files.

http://standards.freedesktop.org/desktop-entry-spec/

http://standards.freedesktop.org/menu-spec/

It is also possible to add Geeqie-specific editors with the Editor Configuration Dialog.

Editors appear in menu Edit / External Editors, unless specified otherwise in the desktop file.

## 4.4.3. Result dialog

Commands that are set to display their output in a window will show a dialog when the command is executed.

The Result dialog will display the command's text output. If the editor command will result in multiple runs of the same command for each file, you can use the Stop button to stop Geeqie from executing the command for remaining files.

Once all commands have completed, or if the Stop button was pressed and the pending command has completed, you can use the Close button, or press Escape, to close the Result dialog. The Result dialog can not be closed while a command is still running.

## 4.4.4.Editor Configuration

#### 4.4.4.1. External Editors

- 4.4.4.1.1. Editors Configuration Dialog
- 4.4.4.1.2. Adding new editor
- 4.4.4.1.3. Modifying an existing editor
- 4.4.4.1.4. Deleting an editor
- 4.4.4.1.5. Special editors
- 4.4.4.1.6. Geeqie extensions

##### 4.4.4.1.1.Editors Configuration Dialog

This dialog allows user to add new editors or modify the system ones. It is available in the menu under Edit / Preferences / Configure Editors.

The Editors dialog shows list of all considerable editors, that is all installed desktop files that have Categories=Graphics or Categories=X-Geeqie.

Name

Editor name as specified in desktop file.

Hidden

An editor can be "Hidden" for one of these reasons:

- the desktop file contains Hidden=TRUE or NoDisplay=TRUE entry
- TryExec binary was not found
- MimeType list does not contain images
- MimeType list is empty and Categories does not contain X-Geeqie

Desktop file

Name of the desktop file, it is used as an identifier in hotkey configuration and in config file.

Path

Full path to the desktop file. Desktop files in user directories override the system ones with the same name.

##### 4.4.4.1.2.Adding new editor

This button opens a text editor with a desktop file template.

    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=Template
    #Name[cs]=
    #Name[fr]=

    # %f	 A single file name, even if multiple files are selected. The
    # system reading the desktop entry should recognize that the program in
    # question cannot handle multiple file arguments, and it should should
    # probably spawn and execute multiple copies of a program for each
    # selected file if the program is not able to handle additional file
    # arguments. If files are not on the local file system (i.e. are on HTTP
    # or FTP locations), the files will be copied to the local file system and
    # %f will be expanded to point at the temporary file. Used for programs
    # that do not understand the URL syntax.
    #
    # %F	A list of files. Use for apps that can open several local files
    # at once. Each file is passed as a separate argument to the executable
    # program.
    #
    # %u	A single URL. Local files may either be passed as file: URLs or
    # as file path.
    #
    # %U	A list of URLs. Each URL is passed as a separate argument to
    # the executable program. Local files may either be passed as file: URLs
    # or as file path.
    #
    # "$GEEQIE_DESTINATION" destination set by Geeqie
    Exec=ln -s %f "$GEEQIE_DESTINATION"

    # Desktop files that are usable only in Geeqie should be marked like this:
    Categories=X-Geeqie;
    OnlyShowIn=X-Geeqie;

    # Show in menu "File"
    X-Geeqie-Menu-Path=FileMenu/FileOpsSection

    # This is a filter - $GEEQIE_DESTINATION is required
    X-Geeqie-Filter=true

    # It can be made verbose
    # X-Geeqie-Verbose=true

##### 4.4.4.1.3.Modifying an existing editor

Edit button opens a text editor with existing desktop file. For desktop files that are not writable by user, it allows saving to Geeqie specific directory, where it overrides the system file (but only for Geeqie).

##### 4.4.4.1.4.Deleting an editor

Delete buttons can delete user writable desktop files. System desktop files can't be deleted directly, but it is possible to edit them and set Hidden=TRUE, see above.

##### 4.4.4.1.5.Special editors

Desktop file with one of the following name has a special function. It replaces the corresponding internal command.

    geeqie-copy-command.desktop
    geeqie-move-command.desktop
    geeqie-rename-command.desktop
    geeqie-delete-command.desktop
    geeqie-folder-command.desktop

This can be used for example for custom trash command or for manipulation with files under version control.

##### 4.4.4.1.6.Geeqie extensions

X-Geeqie

This can be specified in Categories, OnlyShowIn and NotShowIn fields

X-Geeqie-Menu-Path

This can specify the menu path where the editor appears, instead of the default Edit / External editors. Possible values are:

    FileMenu
    FileMenu/OpenSection
    FileMenu/SearchSection
    FileMenu/PrintSection
    FileMenu/FileOpsSection
    FileMenu/QuitSection
    GoMenu
    SelectMenu
    SelectMenu/SelectSection
    SelectMenu/ClipboardSection
    SelectMenu/MarksSection
    SelectMenu/EditMenu
    SelectMenu/ExternalMenu
    SelectMenu/EditSection
    SelectMenu/OrientationMenu
    SelectMenu/PropertiesSection
    SelectMenu/PreferencesMenu
    SelectMenu/PreferencesSection
    ViewMenu
    ViewMenu/WindowSection
    ViewMenu/FileDirMenu
    ViewMenu/FileDirMenu/FolderSection
    ViewMenu/FileDirMenu/ListSection
    ViewMenu/DirSection
    ViewMenu/ZoomMenu
    ViewMenu/ZoomMenu/ConnectZoomMenu
    ViewMenu/SplitMenu
    ViewMenu/ColorMenu
    ViewMenu/OverlayMenu
    ViewMenu/ViewSection
    ViewMenu/ToolsSection
    ViewMenu/SlideShowSection
    HelpMenu
    HelpMenu/HelpSection

X-Geeqie-Filter

Specifies that the editor is a filter - it requires source and destination path. The destination path is in shell variable $GEEQIE_DESTINATION or, more correctly, it can be queried be geeqie -r, like in the geeqie-symlink command:

    #!/bin/sh

    # This is a helper script that symlinks grouped files
    # it uses geeqie remote connection to get details about grouped files

    # iterate over files on commandline
    for file in "$@" ; do
        # we got only one file for each group, typically the main one
        # get the sidecars:
        geeqie -r --get-sidecars:"$file" |while read sidecar ; do
            # the main file is included in the sidecar file list, no special handling is required
            # get destination path for each sidecar file:
            geeqie -r --get-destination:"$sidecar" | if read destination ; then
                ln -s "$sidecar" "$destination"
            fi
        done
    done