##Who?##
Linux users with basic scripting knowledge.
##Why?##
You’d like to apply a script (or simply a command) to photos in a directory you’re currently browsing with geeqie. E.g convert multiple files to .gif/A4 pdf/33% of the current size, OCR a tiff in Yagf or generate a thumbnail contact sheet in the current geeqie directory etc. .
##How?##
Write a .desktop file that either contains a one-liner shell command or calls an existing script, optionally with the selected file(s) as argument(s).
##Where?##
Geeqie comes with some defaults for the user in
/usr/share/geeqie/applications/Individual users can store theirs in:
${HOME}/.config/geeqie/applications/
##Details##
You can create these entries via Edit>Preference>Configure Editors…
Here’s an example one-liner that uses imagemagick’s ‘convert’ to requantise a jpg @ 75% quality.
Note:
-
This example has been truncated. See the attached zip for the full entry (recompressJpeg.desktop).
-
See the “Name=Convert to Jpeg @ _75% quality” line? Note the underscore in front of the ‘7’. It creates a keyboard shortcut you can use in the right mouse click/context menu.
-
The %f in the ‘Exec=’ line. That’s a variable for the currently selected file in geeqie. With multiple files selected, geeqie runs the command on each sequentially.
-
To handle multiple files (with possible spaces in the filenames) as input to a script rather than a command , use %U (i.e URL’s) in your .desktop file. Thus you can access these with “$@” . See ‘jpgResize_v0.3.sh’ in the zip. The input to your script will be:
file:///tmp/Example/contains oneSpace.jpg file:///tmp/Example/contains two spaces.jpg
-
Want to prompt the user with a dialog box with sliders and text entry boxes etc.? Use zenity [1 ] (http://www.linux.org/threads/zenity-gui-for-shell-scripts.5567/ “Examples 1”)
2 3 for GTK or kdialog for KDE etc. in the scripts you call. Check ‘jpgResize_v0.3.sh’ in the zip.
Unzip these examples into ${HOME}/.config.geeqie/applications and restart geeqie:
GeeqieDesktopFiles.zip (1.9 KB)
Please excuse my coding.
Zenity can be installed in debian/ubuntu with:
sudo apt-get install zenityin arch/manjaro/antergos:
sudo pacman -S zenity