aboutsummaryrefslogtreecommitdiff
path: root/fiv-update-desktop-files.in
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-03-15 03:31:30 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-03-15 05:52:32 +0100
commit796b05c9a5f04aba87e26c5a8384d84edee20b77 (patch)
tree74b1dbda5521bb39bcf9215c3e884499fca215d2 /fiv-update-desktop-files.in
parent9286858573ef5e430ac2fb24c274a6fcd41a1edd (diff)
downloadfiv-796b05c9a5f04aba87e26c5a8384d84edee20b77.tar.gz
fiv-796b05c9a5f04aba87e26c5a8384d84edee20b77.tar.xz
fiv-796b05c9a5f04aba87e26c5a8384d84edee20b77.zip
Integrate online reverse image search
This makes use of our image processing capabilities in order to turn arbitrary image files into normalized thumbnails, upload them to a temporary host, and pass the resulting URI to a search provider. In future, fiv should ideally run the upload itself, so that its status and any errors are obvious to the user, as well as to get rid of the script's dependency on jq.
Diffstat (limited to 'fiv-update-desktop-files.in')
-rwxr-xr-xfiv-update-desktop-files.in10
1 files changed, 7 insertions, 3 deletions
diff --git a/fiv-update-desktop-files.in b/fiv-update-desktop-files.in
index bbbe9a9..1c8568f 100755
--- a/fiv-update-desktop-files.in
+++ b/fiv-update-desktop-files.in
@@ -1,4 +1,8 @@
#!/bin/sh -e
-sed -i "s|^MimeType=.*|MimeType=$(
- "${DESTDIR:+$DESTDIR/}"'@EXE@' --list-supported-media-types | tr '\n' ';'
-)|" "${DESTDIR:+$DESTDIR/}"'@DESKTOP@'
+fiv=${DESTDIR:+$DESTDIR/}'@FIV@'
+desktopdir=${DESTDIR:+$DESTDIR/}'@DESKTOPDIR@'
+
+types=$("$fiv" --list-supported-media-types | tr '\n' ';')
+for desktop in @DESKTOPS@
+do sed -i "s|^MimeType=.*|MimeType=$types|" "$desktopdir"/"$desktop"
+done