Skip to content

How do you use SXIV?

This might seem a silly question but I just want to know how do you use sxiv to view your images.

  • Firstly, I am very much used to opening an image and go back and forward with my arrow keys. But afaik this not possible in sxiv; you need to open the whole folder with sxiv command. How do you navigate back and forth by opening a single image?
  • If you need minor annotations how do you do that?

Thanks in advance!

5 points14 comments
Open on Reddit
About this post
Posted
Archived
Score
5 · 86% up
Kind
Text
ID
16duc56

Author

22
posts
22
comments
8
media
View profile

14 comments

I just open the images from my graphical file viewer and you can navigate them by pressing n & p for next and previous.

We also have nsxiv in the repos which might be interesting for you :)

2 points

I have written a shell script for lf file manager. Whenever I open an image I can go back and forth:

image/*) bash -c '
shopt -s nullglob
dir="$0"
selected_file="$1"
images=()
for file in "$dir"/*.{jpg,jpeg,png,webp,bmp,tiff,tif,raw,ico,exif,heic,heif,gif,avif,jxl,JPG,PNG}; do
[[ -f "$file" ]] && images+=("$file")
done
sorted_images=()
while IFS= read -r line; do
sorted_images+=("$line")
done < <(printf "%s\n" "${images[@]}" | sort -fV)
for ((i=0; i<${#sorted_images[@]}; i++)); do
[[ "${sorted_images[i]}" = "$selected_file" ]] && {
setsid nsxiv -aon "$((i + 1))" "${sorted_images[@]}"
break
}
done
' "$PWD" "$fx";;

2 points

sxiv *.png or sxiv ~/pictures/*

I've never used annotations, can't help you there.

1 points

Not sure if this works with sxiv, but with nsxiv (a maintained fork) you can just pass a directory like this: nsxiv .

2 points

Isn't giving this command every time you want to view a folder's images a bit tiring?

0 points

No. It's super short and you can tab-complete it. Plus if you're lazier there's always ctrl-r.

3 points

you can use “sxiv image-to-see” and navigate with “n” for next and “p” for previous.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.