aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsomini <dev@somini.xyz>2020-12-03 00:18:05 +0000
committerHarry Jeffery <harry@exec64.co.uk>2021-07-08 23:30:24 +0100
commit38eee61bebf266af1ae5b652508134ce613295c5 (patch)
treeed92e90c83a2fe8f12b107be2ff3c396ee8c4440
parenteccd3cf9124d4ff2f4569b0c1fbf7f3a7b008b4d (diff)
downloadimv-38eee61bebf266af1ae5b652508134ce613295c5.tar.gz
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
-rw-r--r--doc/imv-folder.1.txt36
-rw-r--r--doc/imv.1.txt2
-rwxr-xr-xfiles/imv1
-rwxr-xr-xfiles/imv-folder3
-rw-r--r--files/imv-folder.desktop14
-rw-r--r--meson.build19
6 files changed, 68 insertions, 7 deletions
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 <me@harry.pm>
+with contributions from other developers.
+
+Full source code and other information can be found at
+<https://github.com/eXeC64/imv>.
+
+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'],
]