You are not logged in.
On my sxiv-patches repo on GitHub you can now also find a patch that adds Pango support to sxiv - something I wanted considering I also switched DWM and dmenu over to Pango.
Cheers.
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Hello
I'm answering to myself.
1) Exif information view.
Note: Apparently this is already available in version 1.1, thanks for that, but only 1.0-3 is available at the moment in [Community] thus I haven't tested it yet.
No, this is not available but it is explained in the manpage how to customize the status bar, a very nice feature that I didn't notice at first. Thus I obtained what I wanted by putting the following in ~/.sxiv/exec/image-info.
#!/bin/sh
filename=$(basename "$1")
filesize=$(du -Hh "$1" | cut -f 1)
dategeom=$(identify -format "%[EXIF:DateTimeOriginal] | %[width]x%[height]" $1)
echo "$filename | $dategeom ($filesize)" | sed 's/|[ |]*/| /g'
2) Easier customization with .config/sxivrc file instead of config.h.
3) * Last but not least! *
Interactive (that means with file name completion) 'open file' command, like vim's ':edit' or zathura's ':open'.
It's probably a question of taste but I'm quite surprised that this last feature is not available by default. Every document viewer I know, even the most 'suckless' ones, have such an 'open' feature.
I have seen at various places a script which allows to browse through all the images of a directory after a given image in this directory has been opened using sxiv, but this is quite different. I haven't seen any way to launch sxiv with no argument (for example from dmenu instead of ranger) and then browse through the file tree in order to choose and open an image file.
Best regards,
LuX
Last edited by LuX (2013-06-15 22:34:27)
Offline
Do you mean something like
/* open current image with given program: */
{ true, XK_g, it_open_with, (arg_t) "gimp" },
in config.h but with a filename completion?
Many shells have such completion, so why not use them?
Last edited by karol (2013-06-02 22:18:17)
Offline
Hello!
Do you mean something like
I really mean something like :edit in vim or :open in zathura.
Many shells have such completion, so why not use them?
Is sxiv required to be launched from a terminal emulator or a file manager? Why should it be?
There are several widely used habits in viewing documents on a PC:
- some people first open a terminal emulator and then type a command which links a program name to a file name;
- some people first look for a document (using a file manager) and then for a program to open it;
- some people, including me, first open a document viewer and then look from inside it for the document(s) they want to see.
This last category of people is very large. Some of them launch a document viewer using the applications menu or an icon in a panel, others --more suckless addicts -- prefer to define key bindings for their favourite programs or a text-based launcher like dmenu, or whatever. But for ALL of them an 'open' function is mandatory in every document viewer. This is probably the reason why all the document viewers that I know provide natively this feature.
Sxiv is the only exception I ever met, and as I already said I do regret this because I really like this image viewer.
Regards,
LuX
Last edited by LuX (2013-06-05 11:27:10)
Offline
Is sxiv required to be launched from a terminal emulator or a file manager? Why should it be?
Because its author wants it this way?
Offline
@karol: The authors made a great job building sxiv. Do you really think that they want to force sxiv users to launch it only the two first ways I mentionned and not the third one? I can't imagine any reason why they would...
Last edited by LuX (2013-06-05 11:30:27)
Offline
I'm not saying I can read anyone's mind, but e.g. st has some limitations by design:
http://st.suckless.org/goals
Non-goals
* filters that change colour (should be done by tmux or something doing the higher layers in st)
* server to save sessions in case of X crash (should be done by dtach)
* unlimited scrollback buffer (done by dvtm)
* URL selecting/launching in browser similiar to vimperator’s mark mode and the urxvt script (patch?) (possibly piped through something like plumb to
This one is done by a simple shortcut in dwm which will launch your plumber on the current select buffer. St has easy select through double-click. This keeps the complex logic out of the st context.
Offline
It's probably a question of taste but I'm quite surprised that this last feature is not available by default. Every document viewer I know, even the most 'suckless' ones, have such an 'open' feature.
LuX
Look at mupdf.
In general, I think sxiv is good the way it is and feature-complete. If you don't like the shell, you can use a filemanager. That being said Maybe ber_t or someone else (you?) is nice enough to provide such a feature in a seperate branch or as a optional patch.
Offline
Hello!
st has some limitations by design:
And so does sxiv. I understand that 'limitation by design' is a good way of being more efficient, it is just what I like in sxiv and other suckless programs. However it appears that there is 'suckless' and 'suckless'! IMHO vim and mostly zathura are excellent programs with a suckless flavour (I could also mention mutt) although they are not part of the suckless.org project... and they provide an 'open' feature.
Also dmenu (more exactly dmenu_run), which is part of the suckless.org project, is commonly used for launching programs without file name arguments, that is just the 'third way' of viewing document in my post #304. Thus sxiv as it is now is not compatible with this suckless tool, or suckless way of doing. (Of course dmenu can be used in many other ways too.)
If you don't like the shell, you can use a filemanager.
I already answered to this: there is a third way, which can be used by suckless addicts as well as the two other ways that you prefer.
By the way I didn't know about mupdf, but now I know why I prefer zathura... (EDIT: Actually mupdf can be used as a plugin for zathura, alternatively to poppler.)
That being said Maybe ber_t or someone else (you?) is nice enough to provide such a feature in a seperate branch or as a optional patch.
I wish I could but I'm just an ordinary user, not a programmer. I wonder if it can be copy-pasted from zathura's source...
Nevertheless I agree with you that this feature could as well be provided separately, and most of all that the end decision belongs to ber_t (who is the single author of sxiv, isn't he?) to design sxiv for every 'suckless friendly' users or only for some of them.
Thank you for discussing, sheers,
LuX
Last edited by LuX (2013-06-06 11:16:24)
Offline
Thank you for sxiv, I love it.
2) Easier customization with .config/sxivrc file instead of config.h.
This is a feature, it makes sxiv faster. dwm does the same thing.
On my sxiv-patches repo on GitHub you can now also find a patch that adds Pango support to sxiv - something I wanted considering I also switched DWM and dmenu over to Pango.
Cheers.
Thank you for these patches!
I changed the rifle_sxiv.sh script a bit, so when I execute "rifle_sxiv.sh <directory>" it will open all the images in the directory, starting with the first one.
#!/bin/sh
# Based on the original rifle_sxiv.sh, but this can take directories as a parameter.
[ "$1" == "--" ] && shift
if [ -z "$1" ]; then
TARGET="$PWD"
elif [ -d "$1" ]; then
TARGET="$(realpath "$1")"
elif [ -f "$1" ]; then
TARGET="$(realpath $(dirname "$1"))"
else
echo "Error: The given file or directory could not be found."
exit 1
fi
listfiles() {
find -L "$TARGET" -maxdepth 1 -type f -iregex '.*\(jpe?g\|bmp\|png\|gif\)$' -print0 | sort -z
}
COUNT="$(listfiles | grep -m 1 -ZznF "$1" | cut -d: -f1)"
echo $COUNT
if [ -n "$COUNT" ]; then
listfiles | xargs -0 sxiv -q -n "$COUNT" --
else
sxiv -q -- "$@" # fallback
fi
Last edited by doggone (2013-06-22 16:01:10)
Offline
LuX wrote:2) Easier customization with .config/sxivrc file instead of config.h.
This is a feature, it makes sxiv faster.
How many milliseconds faster?
How much time spent editing the code and recompiling it? Specially when you are not a programmer and don't know anything about C?
Cheers
Last edited by LuX (2013-06-21 13:17:24)
Offline
LuX, if you are that eager for it, then make a feature request on their issue tracker.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
I changed the rifle_sxiv.sh script a bit, so when I execute "rifle_sxiv.sh <directory>" it will open all the images in the directory, starting with the first one.
--snip--
In my file manager I use this script with "s/sxiv/feh/" of course. Clicking an image in the file manager will open it in sxiv, while I am still able to browse all the images in the folder with the prev/next keys. Actually I have no idea how this script works (haven't looked it in detail), but it works for me (in ROX).
There are two types of people in this world - those who can count to 10 by using their fingers, and those who can count to 1023.
Offline
Great piece of code you put together here.
I just noticed it's not possible to use the following settings together:
{ false, XK_Right, i_navigate, (arg_t) +1 }, { false, XK_Left, i_navigate, (arg_t) -1 }, { false, XK_Left, it_scroll_move, (arg_t) DIR_LEFT }, { false, XK_Right, it_scroll_move, (arg_t) DIR_RIGHT },
Even though they do not occur in the same environment and *could* be used, the first works while the second does not.
Could it be this just requires an easy fix?
Could anyone please answer this? I'm looking for the same thing.
Offline
First of all: Thanks b_ert for this nice image viewer. I switched instantly from feh to sxiv
Unfortunately I'm encountering a strange problem:
When viewing pictures, sometimes my laptop suddently turns the backlight off. Switching to a VT with ctrl-alt-F1 and then back to X sometimes solves the issue. Sometimes X just crashes when i switch back. Quite strange. Anybody also have this problem? Guess it's a X Bug, but so far it only happend when using sxiv.
Here a log of the Xorg crash:
Aug 11 12:45:17 x230 slim[565]: (EE)
Aug 11 12:45:17 x230 slim[565]: (EE) Backtrace:
Aug 11 12:45:17 x230 slim[565]: (EE) 0: /usr/bin/X (xorg_backtrace+0x3d) [0x57f71d]
Aug 11 12:45:17 x230 slim[565]: (EE) 1: /usr/bin/X (0x400000+0x183489) [0x583489]
Aug 11 12:45:17 x230 slim[565]: (EE) 2: /usr/lib/libpthread.so.0 (0x7f76ef162000+0xf0e0) [0x7f76ef1710e0]
Aug 11 12:45:17 x230 slim[565]: (EE) 3: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f76ecd2c000+0x360b7) [0x7f76ecd620b7]
Aug 11 12:45:17 x230 slim[565]: (EE) 4: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f76ecd2c000+0x385a7) [0x7f76ecd645a7]
Aug 11 12:45:17 x230 slim[565]: (EE) 5: /usr/lib/xorg/modules/drivers/intel_drv.so (0x7f76ecd2c000+0x42ff3) [0x7f76ecd6eff3]
Aug 11 12:45:17 x230 slim[565]: (EE) 6: /usr/bin/X (miPaintWindow+0x1d1) [0x5621a1]
Aug 11 12:45:17 x230 slim[565]: (EE) 7: /usr/bin/X (miWindowExposures+0x1d5) [0x562a75]
Aug 11 12:45:17 x230 slim[565]: (EE) 8: /usr/bin/X (miHandleValidateExposures+0x68) [0x577e08]
Aug 11 12:45:17 x230 slim[565]: (EE) 9: /usr/bin/X (SetRootClip+0x1d0) [0x465c70]
Aug 11 12:45:17 x230 slim[565]: (EE) 10: /usr/bin/X (0x400000+0xb7594) [0x4b7594]
Aug 11 12:45:17 x230 slim[565]: (EE) 11: /usr/bin/X (xf86Wakeup+0x54a) [0x47476a]
Aug 11 12:45:17 x230 slim[565]: (EE) 12: /usr/bin/X (WakeupHandler+0x6d) [0x43b4fd]
Aug 11 12:45:17 x230 slim[565]: (EE) 13: /usr/bin/X (WaitForSomething+0x1af) [0x57ccef]
Aug 11 12:45:17 x230 slim[565]: (EE) 14: /usr/bin/X (0x400000+0x36fe1) [0x436fe1]
Aug 11 12:45:17 x230 slim[565]: (EE) 15: /usr/bin/X (0x400000+0x268b5) [0x4268b5]
Aug 11 12:45:17 x230 slim[565]: (EE) 16: /usr/lib/libc.so.6 (__libc_start_main+0xf5) [0x7f76ee1e8a15]
Aug 11 12:45:17 x230 slim[565]: (EE) 17: /usr/bin/X (0x400000+0x26bfd) [0x426bfd]
Aug 11 12:45:17 x230 slim[565]: (EE)
Aug 11 12:45:17 x230 slim[565]: (EE) Segmentation fault at address 0x0
Aug 11 12:45:17 x230 slim[565]: (EE)
Aug 11 12:45:17 x230 slim[565]: Fatal server error:
Aug 11 12:45:17 x230 slim[565]: (EE) Caught signal 11 (Segmentation fault). Server aborting
Aug 11 12:45:17 x230 slim[565]: (EE)
Aug 11 12:45:17 x230 slim[565]: (EE)
Aug 11 12:45:17 x230 slim[565]: Please consult the The X.Org Foundation support
Aug 11 12:45:17 x230 slim[565]: at http://wiki.x.org
Aug 11 12:45:17 x230 slim[565]: for help.
Aug 11 12:45:17 x230 slim[565]: (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
Aug 11 12:45:17 x230 slim[565]: (EE)
Aug 11 12:45:17 x230 slim[565]: (II) AIGLX: Suspending AIGLX clients for VT switch
Aug 11 12:45:17 x230 slim[565]: xsetroot: unable to open display ':0.0'
Aug 11 12:45:17 x230 slim[565]: (EE) Server terminated with error (1). Closing log file.
Last edited by ccc1 (2013-08-11 14:27:37)
Offline
Is it possible to make sxiv read images from the standard input? Feh can do it, I think it's a pretty useful feature.
Offline
Is it possible to make sxiv read images from the standard input? Feh can do it, I think it's a pretty useful feature.
What does the man page say?
Offline
How much time spent editing the code and recompiling it? Specially when you are not a programmer and don't know anything about C?
Editing config.h is actually extremely easy: what it requires is basically some logic and copy and pasting. Previous experience in C is not required. The time needed to edit config.h is the same as for every other text file, while rebuilding should take no more than 15 seconds (including package upgrade: 'makepkg -srci' should take care of everything). Sounds sane I guess.
When viewing pictures, sometimes my laptop suddently turns the backlight off. Switching to a VT with ctrl-alt-F1 and then back to X sometimes solves the issue. Sometimes X just crashes when i switch back.
I have experienced exactly the same behaviour with mplayer2 & intel GPU recently, after upgrading ffmpeg. It occurred several times in a row, but restarting X helped somehow. I'm using sxiv-git and it's working just fine, so I believe that the culprit may indeed reside somewhere inside the video driver / X server chain. (Sorry for no logs: there's no trace of any segfault nor anything significant whatsoever.)
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
What does the man page say?
There's -i to read image names to open, I'd like to be able to do that with the actual images.
Offline
karol wrote:What does the man page say?
There's -i to read image names to open, I'd like to be able to do that with the actual images.
Standard input accepts text, so I don't know how do you plan to feed ti actual images.
Offline
ikuchan wrote:karol wrote:What does the man page say?
There's -i to read image names to open, I'd like to be able to do that with the actual images.
Standard input accepts text, so I don't know how do you plan to feed ti actual images.
cat image.png | sxiv -
Offline
Why would you do that?
I think it's a pretty useful feature.
What would be the use case?
Offline
i can't seem to get images to fit to the window, the -d option does nothing, and different -z values are also not useful.
Offline
i can't seem to get images to fit to the window, the -d option does nothing, and different -z values are also not useful.
'-s'?
Offline
same result as the other two. i still need to scroll to see the whole image.
Offline