NSXIV(1)
π NSXIV(1) β General Commands Manual π
okay bestie, sit down, hydrate, because we're about to talk about nsxiv β the manual page, her whole lore, every single flag. no skimming, we're doing this properly. π
β¨ NAME β¨
nsxiv β Neo Simple X Image Viewer. that's her. that's the whole name. iconic behavior honestly. π¦
πΈ SYNOPSIS πΈ
nsxiv [-abcfHhiopqrtvZ0] [-A FRAMERATE] [-e WID] [-G GAMMA] [-g
GEOMETRY] [-N NAME] [-n NUM] [-S DELAY] [-s MODE] [-z ZOOM] FILE...
like. look at her. a whole alphabet of options and then a pile of files at the end. she's organized. she's got range. π
π DESCRIPTION π
nsxiv is a simple image viewer for X. simple!! but do not let that word fool you, she is doing a LOT under the hood, and we're gonna appreciate every bit of it.
she has two modes of operation: image mode and thumbnail mode.
- the default is image mode, where only the current image is shown. one image. main character energy. π
- in thumbnail mode, you get a whole grid of tiny previews, so it's super easy to pick which image you wanna open. it's giving Pinterest board but make it local files.
ok important note before we go any further: the fullscreen mode requires an EWMH/NetWM-compliant window manager. no compliant WM, no fullscreen. that's not a vibe, that's a requirement. π
π OPTIONS π
every single flag, no crumbs left behind:
-A,--framerate FRAMERATEβ play animations with a constant frame rate set to FRAMERATE. and bestie listen, if FRAMERATE is set to0, then animation playback is disabled. zero means bye-bye animation.-a,--animateβ play the animations of multi-frame images. let them move, let them live. β¨-bβ do not show the statusbar.--bar,--no-barβ turns the statusbar on or off. and btw--no-baris exactly equivalent to-b, no difference at all.-c,--clean-cacheβ removes all orphaned cache files from the thumbnail cache directory, then exits. a lil spring cleaning, then she leaves. π§Ή-e,--embed WIDβ embeds thensxivwindow inside the window whose ID is WID. yes, she can live inside another window. nesting, slay.-f,--fullscreenβ starts in fullscreen mode. immediately. no build-up.-G,--gamma GAMMAβ set image gamma to GAMMA, and the range is-32..32. mind the range bestie.-g,--geometry GEOMETRYβ sets the window position and size. for the full tea on the GEOMETRY argument, check the GEOMETRY SPECIFICATIONS section ofX(7).-H,--hidden[=no]β includes hidden files and directories. and the long option takes an optional"no"if you want to disable it again. sonomeans yes-no. π-h,--helpβ prints brief usage info to standard output and exits. the quick lil "what do I do" button.-i,--stdinβ reads the names of files to open from standard input. and this also happens if FILE is-. yes literally the single dash.-N,--name NAMEβ sets the window name to NAME β that's specifically the"Instance"name ofWM_CLASSas described in ICCCM, not just any name. very specific. very official.-n,--start-at NUMβ starts at picture number NUM. skip the line, go straight to your fave.-o,--stdoutβ writes the list of all marked files to standard output when quitting. and if you pair this with-i,--stdin, you can usensxivas a visual filter/pipe. hello?? that's so clever?? π₯-p,--privateβ enables private mode. in private modensxivwrites no cache or temporary files at all. incognito era. π«₯-q,--quietβ be quiet: disables warnings to the standard error stream. she's not gonna complain, she's gonna sit there and behave.-r,--recursiveβ searches the given directories recursively for images to view. deep dive mode.-S,--ss-delay DELAYβ starts in slideshow mode, with the delay between images set to DELAY seconds. and DELAY may be a floating-point number, so2.5is totally valid, we love precision. β-s,--scale-mode MODEβ sets the scale mode according to the MODE character. the supported modes are:[d]own,[f]it,[F]ill,[w]idth,[h]eight. case matters, bestie,fandFare different girls.-t,--thumbnail[=no]β starts in thumbnail mode. the long option accepts an optional"no"to disable it.-v,--versionβ prints version info to standard output and exits.-Z,--zoom-100β the same as-z 100. just a shortcut, she's efficient.-z,--zoom ZOOMβ sets the zoom level to ZOOM percent.-0,--nullβ useNULL-separator. with this option, the output of-o, the file-list sent to the key-handler, and the input of-iwill all be separated by aNULLcharacter. everything, all at once. π--anti-alias[=no]β enables anti-aliasing, and if you hand itnoas an argument, it disables it instead.--alpha-layer[=no]β enables a checkerboard background for the alpha layer, and if you hand itnoas an argument, it disables it instead.--assume-filesβ skips directory traversal. it's intended for when the list is known to contain only files. this avoids some initial disk operations and may reduce startup time on slow disks. speedrun strat. πββοΈ--cache-allow,--cache-deny CACHE-PATHSβ a list of directories to whitelist or blacklist for thumbnail caching. peep the THUMBNAIL CACHING section for the tea on the argument format. these two options are mutually exclusive, and if you specify them more than once, only the final one takes effect. so don't play games, the last one wins. π--update-cacheβ updates the thumbnail cache (creating them if necessary) of the given arguments and exits. and yes, it can be used along with--clean-cache. combo move. β¨
β¨οΈ KEYBOARD COMMANDS β¨οΈ
π¦ General π¦
these ones work in both image mode and thumbnail mode, so no matter where you are, they've got you:
0-9β prefix the next command with a number (this is called count). it's like a little multiplier you attach to whatever's coming next.qβ quitnsxiv.Qβ quitnsxiv, but additionally prints the current filename when-ois active and no files have been marked. very specific conditions, very specific behavior.Returnβ switch to thumbnail mode / open the selected image in image mode. depends where you are, she adapts.fβ toggle fullscreen mode.bβ toggle the visibility of the statusbar at the bottom of the window.Ctrl-xβ send the next key to the external key-handler. see the EXTERNAL KEY HANDLER section for more.gβ go to the first image.Gβ go to the last image, or to image number count. the number prefix does something here!! use it!!rβ reload image.Dβ remove the current image from the file list and go to the next image. bye bestie. πCtrl-h,Ctrl-Leftβ scroll left one screen width.Ctrl-j,Ctrl-Downβ scroll down one screen height.Ctrl-k,Ctrl-Upβ scroll up one screen height.Ctrl-l,Ctrl-Rightβ scroll right one screen width.+β zoom in.-β zoom out.mβ mark/unmark the current image.Mβ mark/unmark all images starting from the last marked/unmarked image up to the current one. it's a range mark, very satisfying.Ctrl-mβ reverse all image marks.Ctrl-uβ remove all image marks.Nβ go count marked images forward.Pβ go count marked images backward.{β decrease gamma correction by count steps.}β increase gamma correction by count steps.Ctrl-gβ reset gamma correction.Ctrl-[β decrease brightness correction by count steps.Ctrl-]β increase brightness correction by count steps.(β decrease contrast by count steps.)β increase contrast by count steps.
πΈ Thumbnail mode πΈ
these are only available in thumbnail mode, so switch over if you want them:
h,Leftβ move selection left count times.j,Downβ move selection down count times.k,Upβ move selection up count times.l,Rightβ move selection right count times.Rβ reload all thumbnails.
π Image mode π
these are only available in image mode, bestie:
Navigate image list:
n,Spaceβ go count images forward.p,Backspaceβ go count images backward.[β go count* 10images backward. yes that's a multiplication, do the math.]β go count* 10images forward.Ctrl-6β go to the previously viewed image. the "wait go back" key.
Handle multi-frame images:
Ctrl-nβ go count frames of a multi-frame image forward.Ctrl-pβ go count frames of a multi-frame image backward.Ctrl-a,Ctrl-Spaceβ play/stop animations of multi-frame images.
Panning:
h,Leftβ scroll image1/5of window width or count pixels left.j,Downβ scroll image1/5of window height or count pixels down.k,Upβ scroll image1/5of window height or count pixels up.l,Rightβ scroll image1/5of window width or count pixels right.Hβ scroll to left image edge.Jβ scroll to bottom image edge.Kβ scroll to top image edge.Lβ scroll to right image edge.zβ scroll to image center.
Zooming:
=β set zoom level to100%, or count%.wβ set zoom level to100%, but fit large images into the window.Wβ fit image to window.Fβ fill image to window.eβ fit image to window width.Eβ fit image to window height.
Rotation:
<β rotate image counter-clockwise by90degrees.>β rotate image clockwise by90degrees.?β rotate image by180degrees.
Flipping:
|β flip image horizontally._β flip image vertically.
Miscellaneous:
aβ toggle anti-aliasing.Aβ toggle visibility of the alpha-channel, i.e. image transparency.sβ toggle slideshow mode and/or set the delay between images to count seconds.
π±οΈ MOUSE COMMANDS π±οΈ
π Thumbnail mode π
these mouse mappings live in thumbnail mode:
Button1β select the image. and if you double-click it, you go into image mode. double-click = commitment. πButton3β mark/unmark the image. and if you drag while holdingButton3down, you'll mark/unmark multiple images. drag selection, we love to see it.Button4β scroll up by one row.Button5β scroll down by one row.Ctrl-Button4β scroll up by one page.Ctrl-Button5β scroll down by one page.
π Image mode π
these mouse mappings live in image mode:
Button1β go to the next image if the mouse cursor is in the right part of the window, or to the previous image if it's in the left part.Ctrl-Button1β pan the image relative to the mouse cursor.Button2β pan the image according to the mouse cursor position in the window while keeping this button pressed down.Button3β switch to thumbnail mode.Button4β zoom in.Button5β zoom out.
π CONFIGURATION π
the following X resources are supported under "Nsxiv" (like, for example, Nsxiv.bar.font):
window.backgroundβ color of the window backgroundwindow.foregroundβ color of the window foregroundbar.fontβ name of the Xft bar fontbar.backgroundβ color of the bar background. defaults towindow.backgroundbar.foregroundβ color of the bar foreground. defaults towindow.foregroundmark.foregroundβ color of the mark foreground. defaults towindow.foreground
peep xrdb(1) for how to actually change them. π«Ά
and listen: an X resources entry with an empty value means the default (which is defined in config.h) will be used. empty = fallback, not broken.
β WINDOW TITLE β
the window title can be replaced with the output of a user-provided script, which nsxiv calls whenever any of the relevant information changes. the path of this script is:
$XDG_CONFIG_HOME/nsxiv/exec/win-title
and the arguments given to it are (where "Optional" arguments might be empty):
$1β resolved absolute path of the current file$2β current file number$3β total file count$4β image width (Optional: Disabled on thumbnails mode)$5β image height (Optional: Disabled on thumbnails mode)$6β current zoom (Optional: Disabled on thumbnails mode)
and why does she say file instead of image? because nsxiv does not precheck that the input files are valid images. so the total file count may be different from the actual count of valid images. she's honest about it, respect. π
there's also an example script installed together with nsxiv as:
/usr/share/doc/nsxiv/examples/win-title
okay we're not done yet β part 2 is coming, so don't go anywhere bestie π
β¨ STATUS BAR β¨
Okay so you know that lil strip at the bottom? The info sitting on the left side of the status bar can be fully swapped out for whatever a user-provided script spits out. Yes bestie, your bar, your rules. π
The script that nsxiv hits up every time an image gets loaded lives at $XDG_CONFIG_HOME/nsxiv/exec/image-info, and the args it gets handed are:
$1β path to image file (as provided by the user)$2β image width$3β image height$4β fully resolved path to the image file
When you're in thumbnail mode, the script it calls instead is at $XDG_CONFIG_HOME/nsxiv/exec/thumb-info, and the args look like this:
$1β path to image file (as provided by the user)$2β empty$3β empty$4β fully resolved path to the image file
Also there are example scripts installed right alongside nsxiv at /usr/share/doc/nsxiv/examples/image-info and /usr/share/doc/nsxiv/examples/thumb-info. Steal from them, that's literally what they're there for π«Ά
πΉ EXTERNAL KEY HANDLER πΉ
Wanna define extra external keyboard commands? Say less. You do it with a handler program living at $XDG_CONFIG_HOME/nsxiv/exec/key-handler, and it gets invoked when you press Ctrl+x. The next key combo you press gets passed to it as its first argument.
And what comes in via stdin? The images to act upon, which are: all marked images, but only if you're in thumbnail mode and at least one image has been marked β otherwise, just the current image. That's the rule, periodt.
nsxiv(1) will block until the handler terminates. Then it checks which images have been modified and reloads them. Iconic behavior honestly π
By default nsxiv(1) sends one image per-line to stdin, but the moment you use -0 the image list becomes NULL separated and the environment variable "$NSXIV_USING_NULL" gets set to 1. Noted π
The key combo argument looks like this: "[C-][M-][S-]KEY" β where C/M/S mean the Ctrl/Meta(Alt)/Shift modifier states, and KEY is the X keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix.
Now the fun part: if KEY has an uppercase equivalent, S-KEY gets resolved into it. So like, K replaces S-k and Scedilla replaces S-scedilla β but S-Delete is sent as-is. No glow-up for that one, sorry π
There's also an example script installed together with nsxiv at /usr/share/doc/nsxiv/examples/key-handler. Go look, bestie.
πΌοΈ THUMBNAIL CACHING πΌοΈ
nsxiv stores all thumbnails under $XDG_CACHE_HOME/nsxiv/. Cozy little home for them.
Use the command line option -c to remove all orphaned cache files. And after that, run this command inside the cache directory to clean out the empty subdirectories too:
find . -depth -type d -empty ! -name '.' -exec rmdir {} \;
The options --cache-allow or --cache-deny let you whitelist or blacklist certain directories from being cached. The argument is a : separated list of paths, and a * at the beginning of a path means that path should be matched recursively.
For example: --cache-allow "/user/pictures:*/media/pictures" whitelists the "/user/pictures" directory non-recursively and the "/media/pictures" directory recursively. Nothing outside these two directories will be cached. And --cache-deny "*/secret" enables blacklist mode and will not cache anything inside "/secret" or it's subdirectories. π΅οΈβοΈ
Heads up: those paths are shown exactly as the original page has them β /user/pictures and so on. Copy carefully, no cap.
π ORIGINAL AUTHOR π
- Bert Muennich β
<ber.t at posteo.de>
π CURRENT MAINTAINERS π
- NRK β
<nrk at disroot.org> - Berke KocaoΔlu β
<berke.kocaoglu at metu.edu.tr> - TAAPArthur β
<taaparthur at gmail.com> - eylles β
<ed.ylles1997 at gmail.com> - Stein Gunnar Bakkeby β
<bakkeby at gmail.com> - explosion-mental β
<explosion0mental at gmail.com>
The whole squad carrying this thing, we love to see it π«Άβ¨
π CONTRIBUTORS π
For a list of contributors, run git shortlog -s in the nsxiv git repository. Main character energy from everyone who ever sent a patch, fr fr π
πΈ HOMEPAGE πΈ
Website:
https://nsxiv.codeberg.page/
Source code:
https://codeberg.org/nsxiv/nsxiv
π SEE ALSO π
And that's the whole page, bestie β literally all of it π This was nsxiv-34, the NSXIV(1) manual page, and you survived the whole read. Genuinely proud of you for making it all the way to the bottom. Now go press Ctrl+x and write a key-handler like the icon you are π
π¦
π¦ where this page comes from
- alpine 3.24: nsxiv-doc 34-r0 Β· GPL-2.0-or-later
- arch rolling: nsxiv 34-1 Β· GPL-2.0-or-later
- ubuntu stonking: nsxiv 34-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms