Compare commits

..

No commits in common. "e1c92664bea18c22662d6f918da7ebcefeb09ce9" and "cdd82136e04f07d813754c538cb72f99cc12f0b9" have entirely different histories.

2 changed files with 2 additions and 40 deletions

4
.vimrc
View File

@ -43,8 +43,8 @@ set modelines=5 " Number of lines to check for vim: directives at the st
set autoindent " AutomaticAlly indent new line
" Indentation
set ts=2 " Number of spaces in a tab
set sw=2 " Number of spaces for indent
set ts=4 " Number of spaces in a tab
set sw=4 " Number of spaces for indent
set et " Expand tabs into spaces
" Mouse settings

View File

@ -1,38 +0,0 @@
#!/bin/sh
set -e -u
SCRIPTNAME=`basename "${0}"`
usage() {
echo "Import (and overwrite!) Geeqie ratings to Darktable"
echo "Usage: ${SCRIPTNAME} DIRECTORY"
}
if [ "${#}" -ne 1 ] || [ ! -d "${1}" ] ; then
usage
exit 1
fi
# Don't touch XMP files while Darktable is running
[ "`pidof darktable`" ] && { echo "Error: Darktable is running, aborting." ; false ; }
DARKTABLE_DIR=`realpath "${1}"`
GEEQIE_DIR=`realpath "${HOME}/.local/share/geeqie/metadata${DARKTABLE_DIR}"`
RATING_FIELD="xmp:Rating"
count=0
for dt_xmp in `find "${DARKTABLE_DIR}" -maxdepth 1 -type f -name '*.xmp'` ; do
img=`echo "\`basename ${dt_xmp}\`" | sed 's/\.xmp$//'`
gq_xmp="${GEEQIE_DIR}/${img}.gq.xmp"
if [ -r "${dt_xmp}" ] && [ -r "${gq_xmp}" ] ; then
gq_rating=`grep "${RATING_FIELD}" "$gq_xmp" | cut -d'"' -f2`
dt_rating=`grep "${RATING_FIELD}" "$dt_xmp" | cut -d'"' -f2`
if [ "${gq_rating}" ] && [ "${dt_rating}" ] && [ ${gq_rating} -ne ${dt_rating} ] ; then
((++count)) # Pre-increment because post-increment fails with 'set -e' :)
echo "counted"
sed -i 's/'${RATING_FIELD}'="'${dt_rating}'"/'${RATING_FIELD}'="'${gq_rating}'"/' "${dt_xmp}"
fi
fi
done
echo "${count} ratings imported. Remember to activate sidecar scanning at Darktable start-up."