Mercurial > geeqie
annotate plugins/import/geeqie-import @ 1675:5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
author | nadvornik |
---|---|
date | Sun, 28 Jun 2009 08:32:27 +0000 |
parents | |
children | a15dc91173b4 |
rev | line source |
---|---|
1675
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
1 #!/bin/bash |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
2 |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
3 case "$1" in |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
4 gqview) |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
5 srcdir=$HOME/.gqview/metadata |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
6 ;; |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
7 geeqie-1-alpha) |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
8 srcdir=$HOME/.geeqie/metadata |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
9 ;; |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
10 *) |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
11 echo Unknown argument $1 |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
12 exit 1 |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
13 ;; |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
14 esac |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
15 |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
16 destdir=$HOME/.local/share/geeqie/metadata |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
17 |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
18 if [ ! -d $HOME/.local/share/geeqie ] ; then |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
19 echo \"$HOME/.local/share/geeqie\" does not exist |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
20 exit 1 |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
21 fi |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
22 |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
23 for ext in .meta .gq.xmp ; do |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
24 find "$srcdir" -type f -name "*$ext" -print | while read src ; do |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
25 img="${src#$srcdir}" |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
26 img="${img%$ext}" |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
27 dest="$destdir$img$ext" |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
28 if [ -f "$img" -a ! -f "$dest" ] ; then |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
29 mkdir -p "${dest%/*}" |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
30 cp -pr "$src" "$dest" |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
31 echo Importing $ext metadata for \"$img\" |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
32 fi |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
33 done |
5bb036e67d6d
added script for importing GQView and Geeqie-alpha metadata
nadvornik
parents:
diff
changeset
|
34 done |