| 1 | sxiv: Simple (or small or suckless) X Image Viewer |
| 2 | |
| 3 | sxiv is an alternative to feh and qiv. Its only dependency besides xlib is |
| 4 | imlib2. The primary goal for writing sxiv is to create an image viewer, which |
| 5 | only has the most basic features required for fast image viewing (the ones I |
| 6 | want). It has vi key bindings and works nicely with tiling window managers. |
| 7 | Its code base should be kept small and clean to make it easy for you to dig |
| 8 | into it and customize it for your needs. |
| 9 | |
| 10 | Installation |
| 11 | ============ |
| 12 | sxiv is built using the commands: |
| 13 | |
| 14 | $ make |
| 15 | # make install |
| 16 | |
| 17 | Please note, that the latter one requires root privileges. |
| 18 | By default, sxiv is installed using the prefix "/usr/local", so the full path |
| 19 | of the executable will be "/usr/local/bin/sxiv". |
| 20 | |
| 21 | You can install it into a directory of your choice by changing the second |
| 22 | command to: |
| 23 | |
| 24 | # make PREFIX="/your/dir" install |
| 25 | |
| 26 | All build-time specific settings can be found in the file "config.h". Please |
| 27 | check and change them, so that they fit your needs. |
| 28 | |
| 29 | Additional features |
| 30 | ------------------- |
| 31 | |
| 32 | The XFLAGS and XLIBS macros/environment variables control which additional |
| 33 | features (i.e. non-default compile-time features) should be enabled and |
| 34 | included during compilation. |
| 35 | |
| 36 | The following table lists the available additional features--the column |
| 37 | *Requires* indicates, which libraries need to be installed for a feature; the |
| 38 | columns *XFLAGS* and *XLIBS* show, what needs to be added to these |
| 39 | macros/environment variables to enable the corresponding feature: |
| 40 | |
| 41 | Feature | Requires | XFLAGS | XLIBS |
| 42 | ----------------------------------+----------+----------------+-------- |
| 43 | GIF support: Load all frames and | giflib | -DGIF_SUPPORT | -lgif |
| 44 | play animations of GIF files | | | |
| 45 | ----------------------------------+----------+----------------+-------- |
| 46 | EXIF support: auto-orientate JPEG | libexif | -DEXIF_SUPPORT | -lexif |
| 47 | files according to their EXIF tag | | | |
| 48 | |
| 49 | For instance, to enable GIF and EXIF support, the giflib and libexif libraries |
| 50 | need to be installed on your system and you either need to change the first |
| 51 | build command to: |
| 52 | |
| 53 | $ make XFLAGS="-DGIF_SUPPORT -DEXIF_SUPPORT" XLIBS="-lgif -lexif" |
| 54 | |
| 55 | Or you need to run the following commands before building sxiv: |
| 56 | |
| 57 | $ export XFLAGS="-DGIF_SUPPORT -DEXIF_SUPPORT" |
| 58 | $ export XLIBS="-lgif -lexif" |
| 59 | |
| 60 | Usage |
| 61 | ===== |
| 62 | sxiv has two modes of operation: image and thumbnail mode. The default is image |
| 63 | mode, in which only the current image is shown. In thumbnail mode a grid of |
| 64 | small previews is displayed, making it easy to choose an image to open. |
| 65 | |
| 66 | sxiv supports the following command-line options: |
| 67 | |
| 68 | -c Remove all orphaned cache files from thumbnail cache and exit |
| 69 | -d Scale all images to 100%, but fit large images into window |
| 70 | -F Use size-hints to make the window fixed/floating |
| 71 | -f Start in fullscreen mode |
| 72 | -g GEOMETRY Set window position and size |
| 73 | (see section GEOMETRY SPECIFICATIONS of X(7)) |
| 74 | -n NUM Start at picture NUM |
| 75 | -p Pixelize, i.e. turn off image anti-aliasing |
| 76 | -q Be quiet, disable warnings |
| 77 | -r Search given directories recursively for images |
| 78 | -s Scale all images to fit into window |
| 79 | -t Start in thumbnail mode |
| 80 | -v Print version information and exit |
| 81 | -Z Same as `-z 100' |
| 82 | -z ZOOM Scale all images to current zoom level, use ZOOM at startup |
| 83 | |
| 84 | The following key mappings are available; differences between image view and |
| 85 | thumbnail mode are denoted via brackets: |
| 86 | |
| 87 | q Quit sxiv |
| 88 | Return Switch to thumbnail mode [open selected image] |
| 89 | |
| 90 | n,Space Go to the next image |
| 91 | p,Backspace Go to the previous image |
| 92 | g,G Go to [select] first/last image |
| 93 | [,] Go 10 images backward/forward |
| 94 | |
| 95 | Ctrl-n,p Go to the next/previous frame of a multi-frame image |
| 96 | Ctrl-Space Play/pause animation of a multi-frame image |
| 97 | |
| 98 | +,= Zoom in |
| 99 | - Zoom out |
| 100 | 0 Set zoom level to 100% |
| 101 | w Fit image into window |
| 102 | |
| 103 | h,j,k,l Pan image [move selection] left/down/up/right |
| 104 | (also with arrow keys) |
| 105 | H,J,K,L Pan to left/bottom/top/right image edge |
| 106 | Ctrl-h,j,k,l Pan image one window width/height left/down/up/right |
| 107 | (also with Ctrl-arrow keys) |
| 108 | |
| 109 | <,> Rotate image (counter-)clockwise by 90 degrees |
| 110 | |
| 111 | W Resize window to fit image |
| 112 | f Toggle fullscreen mode (requires an EWMH/NetWM compliant |
| 113 | window manager) |
| 114 | |
| 115 | a Toggle anti-aliasing |
| 116 | A Toggle visibility of alpha-channel, i.e. transparency |
| 117 | D Remove image from file list and go to [select] next image |
| 118 | r Reload image |
| 119 | |
| 120 | Additionally, the following mouse mappings are available: |
| 121 | |
| 122 | Button1 Go to the next image |
| 123 | [select image/open image if it is already selected] |
| 124 | Button2 Drag image with mouse while keeping it pressed |
| 125 | Button3 Go to the previous image |
| 126 | ScrollUp Pan image up [scroll up one thumbnail row] |
| 127 | ScrollDown Pan image down [scroll down one thumbnail row] |
| 128 | Shift+ScrollUp Pan image left |
| 129 | Shift+ScrollDown Pan image right |
| 130 | Ctrl+ScrollUp Zoom in |
| 131 | Ctrl+ScrollDown Zoom out |