From 38eee61bebf266af1ae5b652508134ce613295c5 Mon Sep 17 00:00:00 2001 From: somini Date: Thu, 3 Dec 2020 00:18:05 +0000 Subject: Include support for imv-folder This is a wrapper to open all images in a folder. Includes: - Script itself - Man page - Desktop file - Necessary Makefile changes Fix #223 --- doc/imv-folder.1.txt | 36 ++++++++++++++++++++++++++++++++++++ doc/imv.1.txt | 2 +- files/imv | 1 - files/imv-folder | 3 +++ files/imv-folder.desktop | 14 ++++++++++++++ meson.build | 19 ++++++++++++++----- 6 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 doc/imv-folder.1.txt create mode 100755 files/imv-folder create mode 100644 files/imv-folder.desktop diff --git a/doc/imv-folder.1.txt b/doc/imv-folder.1.txt new file mode 100644 index 0000000..a9d627b --- /dev/null +++ b/doc/imv-folder.1.txt @@ -0,0 +1,36 @@ +///// +vim:set ts=4 sw=4 tw=82 noet: +///// +:quotes.~: + +imv (1) +======= + +Name +---- +imv-folder - Open 'imv' for all images in a folder + +Description +----------- + +'imv-folder' is a wrapper for 'imv' that auto-selects the folder where the image is located, so that the *next* and *previous* commands function in the same way as other image viewers. + +Note that this wrapper supports only a single image. For opening multiple images, use plain `imv`. + +Synopsis +-------- +'imv-folder' path + +Authors +------- + +imv is written and maintained by Harry Jeffery +with contributions from other developers. + +Full source code and other information can be found at +. + +See Also +-------- + +**imv**(1) diff --git a/doc/imv.1.txt b/doc/imv.1.txt index 7c4af97..cc79e71 100644 --- a/doc/imv.1.txt +++ b/doc/imv.1.txt @@ -330,4 +330,4 @@ Full source code and other information can be found at See Also -------- -**imv**(5) **imv-msg**(1) +**imv**(5) **imv-msg**(1) **imv-folder**(1) diff --git a/files/imv b/files/imv index 90a0706..adff923 100755 --- a/files/imv +++ b/files/imv @@ -1,5 +1,4 @@ #!/bin/sh - if [ -n "${WAYLAND_DISPLAY}" ]; then exec imv-wayland "$@" else diff --git a/files/imv-folder b/files/imv-folder new file mode 100755 index 0000000..c08f339 --- /dev/null +++ b/files/imv-folder @@ -0,0 +1,3 @@ +#!/bin/sh +image="$1" +exec imv "$(dirname "$image")" -n "$image" diff --git a/files/imv-folder.desktop b/files/imv-folder.desktop new file mode 100644 index 0000000..4bec770 --- /dev/null +++ b/files/imv-folder.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Name=imv-folder +Name[en_US]=imv +GenericName=Image viewer +GenericName[en_US]=Image viewer +Comment=Fast freeimage-based Image Viewer | Open all images on a folder +Exec=imv-folder %f +NoDisplay=true +Terminal=false +Type=Application +Categories=Graphics;2DGraphics;Viewer; +MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-pcx;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-tga;image/x-xbitmap; +Icon=multimedia-photo-viewer +Keywords=photo;picture; diff --git a/meson.build b/meson.build index 73137c9..41a4616 100644 --- a/meson.build +++ b/meson.build @@ -155,6 +155,12 @@ foreach ws : ['wayland', 'x11'] endif endforeach +install_data( + files('files/imv-folder'), + install_dir: get_option('bindir'), + install_mode: 'rwxr-xr-x', +) + if not target_single_ws install_data( files('files/imv'), @@ -163,11 +169,13 @@ if not target_single_ws ) endif -install_data( - files('files/imv.desktop'), - install_dir: '@0@/applications'.format(get_option('datadir')), - install_mode: 'rw-r--r--', -) +foreach desktop: ['imv', 'imv-folder'] + install_data( + files('files/@0@.desktop'.format(desktop)), + install_dir: '@0@/applications'.format(get_option('datadir')), + install_mode: 'rw-r--r--', + ) +endforeach install_data( files('files/imv_config'), @@ -196,6 +204,7 @@ prog_a2x = find_program('a2x', required: get_option('man')) if prog_a2x.found() foreach man : [ [1, 'imv'], + [1, 'imv-folder'], [1, 'imv-msg'], [5, 'imv'], ] -- cgit v1.2.3