Photo Funnel: Drag-and-Drop Photo Copying Tool For Linux
Sometimes you need to transfer and organize just a handful of specific photos and raw files from your camera, and a simple GUI tool can help your with that. This tool is just a short Bash shell script uses the YAD tool to generate a drag-and-drop floating palette. When you drop files onto the palette and press the Execute button, the script copies the selected files to the specified directory and organizes them using the ExifTool-based commands.
To deploy the latest version of YAD, you need to compile it from the source. This may sound like a daunting proposition, but it’s actually a rather straightforward process. First, install the required dependencies. On openSUSE Tumbleweed, this can be done using the sudo zypper in intltool gtk2-devel command. Grab then the latest version of YAD from the project’s website, extract the downloaded archive, and switch to the resulting directory. Run then the following commands:
./configure — prefix=/usr
make
sudo make install
Use your preferred text editor to create a text file and paste the code below into it (replace the default ~/backup value with the actual path to the destination directory):
#!/bin/bashdir=’~/backup’f=`yad — center — text-align=center — title=”Photo Funnel” — button=gtk-close:0 — button=gtk-execute:0 — borders=15 — width=250 — height=150 — text=’<big>\nDrop file(s) here.\nPress the <b>Execute</b> button.</big>’ — dnd | sed ‘s/^…….//’`
if [ ! -z “$f” ]; then
if [ ! -d “$dir” ]; then
mkdir “$dir”
fi
cp $f “$dir”
cd “$dir”
exiftool -d %Y%m%d-%H%M%S.%%e ‘-FileName<DateTimeOriginal’ .
exiftool ‘-Directory<CreateDate’ -d ./%Y-%m-%d .
yad — skip-taskbar — undecorated — borders=55 — timeout=3 — no-buttons — center — text=”<big>Import completed. Bye!</big>”
else
yad — skip-taskbar — undecorated — borders=75 — timeout=3 — no-buttons — center — text=”<big>Nothing to do. Bye!</big>”
exit 1
fi
Save the file under the pf name and use the following commands to install the script and make it executable:
sudo cp pf /usr/local/bin/
sudo chown root:root /usr/local/bin/pf
sudo chmod 755 /usr/local/bin/pf
Once you’ve done that, press Alt+F2 and type pf. Drop then the desired photos and raw files onto the floating palette and press the Execute button. This should copy the files to the specified destination directory, rename them, and organize them into folders.
This is an excerpt from the Linux Photography book. Get your copy here.