imv/README.md

160 lines
5.4 KiB
Markdown
Raw Permalink Normal View History

2019-02-15 23:29:24 +01:00
[![builds.sr.ht status](https://builds.sr.ht/~exec64/imv.svg)](https://builds.sr.ht/~exec64/imv?)
2015-11-10 17:51:16 +01:00
imv - X11/Wayland Image Viewer
==============================
2015-11-05 20:57:24 +01:00
2015-11-06 19:01:05 +01:00
`imv` is a command line image viewer intended for use with tiling window managers.
2015-11-05 20:57:24 +01:00
2021-12-08 02:36:00 +01:00
[Project home](https://sr.ht/~exec64/imv/)
2023-01-18 23:20:35 +01:00
imv is currently seeking a new maintainer to adopt it. Please email the author if interested.
2015-11-06 19:01:05 +01:00
Features
--------
2019-08-12 21:53:08 +02:00
* Native Wayland and X11 support
2019-08-20 20:26:19 +02:00
* Support for dozens of image formats including:
2019-08-21 22:00:22 +02:00
* PNG
* JPEG
2019-08-20 20:26:19 +02:00
* Animated GIFs
2019-01-21 23:49:11 +01:00
* SVG
2019-08-21 22:00:22 +02:00
* TIFF
* Various RAW formats
* Photoshop PSD files
2018-05-08 21:22:29 +02:00
* Configurable key bindings and behaviour
2019-08-20 20:26:19 +02:00
* Highly scriptable with IPC via imv-msg
2015-11-05 23:31:38 +01:00
2019-08-27 22:50:37 +02:00
Packages
--------
2019-08-30 01:57:45 +02:00
[![Packaging status](https://repology.org/badge/vertical-allrepos/imv.svg)](https://repology.org/project/imv/versions)
2019-08-27 22:50:37 +02:00
2018-05-08 21:22:29 +02:00
Example Usage
-------------
The following examples are a quick illustration of how you can use imv.
2019-08-21 22:00:22 +02:00
For detailed documentation see the man page.
2015-11-06 19:01:05 +01:00
2019-08-21 22:00:22 +02:00
# Opening images
2018-05-08 21:22:29 +02:00
imv image1.png another_image.jpeg a_directory
2019-08-21 22:00:22 +02:00
# Opening a directory recursively
2018-05-08 21:22:29 +02:00
imv -r Photos
2015-11-06 19:01:05 +01:00
2019-08-21 22:00:22 +02:00
# Opening images via stdin
find . -type f -name "*.svg" | imv
2015-11-09 15:56:46 +01:00
2019-08-21 22:00:22 +02:00
# Open an image fullscreen
2015-12-26 04:09:42 +01:00
imv -f image.jpeg
2015-11-06 19:01:05 +01:00
2019-08-21 22:00:22 +02:00
# Viewing images in a random order
find . -type f -name "*.png" | shuf | imv
2016-01-13 02:15:12 +01:00
2019-08-21 22:00:22 +02:00
# Viewing images from stdin
2016-01-13 02:15:12 +01:00
curl http://somesi.te/img.png | imv -
2015-11-06 19:01:05 +01:00
2019-08-21 22:00:22 +02:00
# Viewing multiple images from the web
curl -Osw '%{filename_effective}\n' 'http://www.example.com/[1-10].jpg' | imv
### Slideshow
imv can be used to display slideshows. You can set the number of seconds to
show each image for with the `-t` option at start up, or you can configure it
at runtime using the `t` and `T` hotkeys to increase and decrease the image
display time, respectively.
To cycle through a folder of pictures, showing each one for 10 seconds:
imv -t 10 ~/Pictures/London
#### Custom configuration
imv's key bindings can be customised to trigger custom behaviour:
[binds]
# Delete and then close an open image by pressing 'X'
<Shift+X> = exec rm "$imv_current_file"; close
# Rotate the currently open image by 90 degrees by pressing 'R'
<Shift+R> = exec mogrify -rotate 90 "$imv_current_file"
2019-08-20 20:26:19 +02:00
2019-08-21 22:00:22 +02:00
# Use dmenu as a prompt for tagging the current image
2019-08-23 22:07:53 +02:00
u = exec echo "$imv_current_file" >> ~/tags/$(ls ~/tags | dmenu -p "tag")
2019-08-21 22:00:22 +02:00
### Scripting
With the default bindings, imv can be used to select images in a pipeline by
using the `p` hotkey to print the current image's path to stdout. The `-l` flag
can also be used to tell imv to list the remaining paths on exit for a "open
set of images, close unwanted ones with `x`, then quit imv to pass the
remaining images through" workflow.
2015-11-12 19:49:11 +01:00
2019-08-20 20:26:19 +02:00
Key bindings can be customised to run arbitrary shell commands. Environment
variables are exported to expose imv's state to scripts run by it. These
scripts can in turn modify imv's behaviour by invoking `imv-msg` with
`$imv_pid`.
For example:
#!/usr/bin/bash
imv "$@" &
imv_pid = $!
while true; do
# Some custom logic
# ...
# Close all open files
imv-msg $imv_pid close all
# Open some new files
imv-msg $imv_pid open ~/new_path
# Run another script against the currently open file
2019-08-23 22:07:53 +02:00
imv-msg $imv_pid exec another-script.sh '$imv_current_file'
2019-08-20 20:26:19 +02:00
done
2015-11-12 19:49:11 +01:00
2015-11-10 17:53:38 +01:00
Installation
------------
2019-08-21 20:29:27 +02:00
### Dependencies
| Library | Version | Notes |
|---------------:|:---------|------------------------------------------------|
| pthreads | | Required. |
| xkbcommon | | Required. |
| pangocairo | | Required. |
| icu | | Required. |
2019-08-21 20:29:27 +02:00
| X11 | | Optional. Required for X11 support. |
| GLU | | Optional. Required for X11 support. |
| xcb | | Optional. Required for X11 support. |
| xkbcommon-x11 | | Optional. Required for X11 support. |
| wayland-client | | Optional. Required for Wayland support. |
| wayland-egl | | Optional. Required for Wayland support. |
2019-08-21 22:02:46 +02:00
| EGL | | Optional. Required for Wayland support. |
2019-08-21 20:29:27 +02:00
| FreeImage | | Optional. Provides PNG, JPEG, TIFF, GIF, etc. |
| libtiff | | Optional. Provides TIFF support. |
| libpng | | Optional. Provides PNG support. |
| libjpeg-turbo | | Optional. Provides JPEG support. |
2019-08-21 20:29:27 +02:00
| librsvg | >=v2.44 | Optional. Provides SVG support. |
| libnsgif | | Optional. Provides animated GIF support. |
2020-06-29 03:03:00 +02:00
| libheif | | Optional. Provides HEIF support. |
2019-08-21 20:29:27 +02:00
Dependencies are determined by which backends and window systems are enabled
when building `imv`. You can find a summary of which backends are available
in [meson_options.txt](meson_options.txt)
$ meson build/
$ ninja -C build/
# ninja -C build/ install
2015-11-10 17:53:38 +01:00
`--prefix` controls installation prefix. If more control over installation
paths is required, `--bindir`, `--mandir` and `--datadir` are
available. Eg. to install `imv` to home directory, run:
$ meson --bindir=~/bin --prefix=~/.local
2015-11-06 19:01:05 +01:00
License
-------
2019-08-21 22:04:04 +02:00
`imv`'s source is published under the terms of the [MIT](LICENSE) license.