You are not logged in.

#351 2013-12-11 13:30:34

Doomcide
Member
Registered: 2011-08-22
Posts: 221

Re: sxiv - Simple image viewer written in C

ikuchan wrote:

Is it possible to make sxiv read images from the standard input? Feh can do it, I think it's a pretty useful feature.

I actually found a use case for this (for me). mutt can pipe mail attachments to a program and this way you could use sxiv to open an attached image without having to download it to your hd. So I think I second this suggestion.

Offline

#352 2014-01-06 17:27:16

thrakcattack
Member
Registered: 2014-01-06
Posts: 3

Re: sxiv - Simple image viewer written in C

I have a little problem, I can't seem to find a solution for.
The file ~/.sxiv/exec/key-handler is not executed by sxiv.
I tested with ratpoison and xfce4 but it did not work with either.
(The script is executable and works when invoked from cli)
I would appreciate any help!

Offline

#353 2014-01-07 23:03:18

likytau
Member
Registered: 2012-09-02
Posts: 142

Re: sxiv - Simple image viewer written in C

* feh replacement
* in [community]
* supports disabling of AA and alpha channel
* supports animation
* switchable thumbnail mode.

Oh hell yes.

The only thing I miss here is cursor-key navigation for non-thumbnail mode. And actions. I miss actions (but it looks like maybe I can implement something similar?)

Offline

#354 2014-01-07 23:51:59

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: sxiv - Simple image viewer written in C

You can assign keybindings to commands e.g. https://wiki.archlinux.org/index.php/Sx … ts_to_sxiv

Offline

#355 2014-01-08 05:28:44

shmibs
Member
Registered: 2012-09-11
Posts: 93
Website

Re: sxiv - Simple image viewer written in C

you can also add cursor keybindings by compiling sxiv yourself and customising config.h (see here for more details). just use the AUR version and stick a command to edit config.def.h in there somewhere after the git checkout and before the make statements.
the one thing i'd like to see is xft support, which it looks like somebody has already added in a personal fork.

Last edited by shmibs (2014-01-08 05:29:39)


[site] | [dotfiles] | あたしたち、人間じゃないの?

Offline

#356 2014-01-08 06:05:31

likytau
Member
Registered: 2012-09-02
Posts: 142

Re: sxiv - Simple image viewer written in C

Thank you, that is quite excellent.

* I can implement 'secondary' keybinds like that with xdotool (for someone on Colemak kbd layout with no caps lock, repeatedly shift+d to delete consecutive images from the list is a bit much)
* I could also implement 'go to random' command, except that sxiv seems to clip at the ends (eg. '694<Space>' in a 100-image list just goes to the 100th image, and the only way I have to know the filelist length is pregenerate the filelist.).

* This behaviour seems reasonable for the 'next image/prev image' commands, but it also occurs for the 'goto image #' command. Could that be changed so that it goes to image # [input number modulus image list length]?

* Having a button binding by default for Shift+Button1 to go to prev image would help a lot, as a tablet user. Button1 is very easy and painless to hit in rapid succession wink Button3 is not as easy (more like tapping a keyboard key)

* Playing animated files cancels the rotation for the duration of the animation. Stepping through the animation destroys the rotation state (reset to 0 degrees). EDIT: ber_t promptly fixed this in recent Git

I also wanted to mention other things that impressed me:

* Performance in thumbnail mode. Generating new thumbnails at a good rate, consistently low memory usage, even when I throw a 50000 image list at it smile
* Statusbar is very readable, esp. compared to feh.
* The way you can combine keyboard commands with mouse commands made me grin.10<Button1>, yes!
* Transform (rotate, flip) working on view rather than file. I'll still use Feh's file transforms to normalize the orientation of my scans and photos, but for everything else, view transforms are 100% the way to go!
* Frame-by-frame animation navigation is invaluable.
* Animation playing without eating stupid amounts of ram. (for some reason, other programs seem various degrees of incompetent at accomplishing this task. They try to expand each frame into an RGB(A) image with no transparency,  perhaps?)
* Thumbnail navigation is just 100% less confusing than feh.

I have more feedback, but this will do for now smile

Last edited by likytau (2014-01-10 12:07:25)

Offline

#357 2014-01-08 13:23:59

thrakcattack
Member
Registered: 2014-01-06
Posts: 3

Re: sxiv - Simple image viewer written in C

My keyhandler script works now, I just had to install the sxiv-git from AUR.

Offline

#358 2014-01-09 19:44:13

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

El_Belgicano wrote:

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?

This should be fixed by commit https://github.com/muennich/sxiv/commit … 0b8cd66e5a.

Last edited by ber_t (2014-01-09 19:48:11)

Offline

#359 2014-01-09 19:47:54

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

Unia wrote:

Is it correct the slideshow option has been removed?

The old slideshow code was removed quite some time ago. There's a new version introduced a couple of days ago by this commit: https://github.com/muennich/sxiv/commit … bfcdf782cf

Last edited by ber_t (2014-01-09 21:53:58)

Offline

#360 2014-01-09 19:51:33

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

LuX wrote:

Shall I post here some features wishes ? Well, I hope so...  ;-)

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.

In the new "exec/key-handler" example script there's a handy command to open a new terminal with the full EXIF tag content; bound to Ctrl-e.

2) Easier customization with .config/sxivrc file instead of config.h.

Not coming.

3) * Last but not least! *
Interactive (that means with file name completion) 'open file' command, like vim's ':edit' or zathura's ':open'.

Not coming, too.

Offline

#361 2014-01-09 19:52:38

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

C5OK5Y wrote:

ber_t: I really like your image viewer but I have one question - is there an obstacle preventing the GIF loop feature from being enabled by default? [...] I'm sure that having GIF looping enabled by default will benefit more people than having it disabled.

It benefits me to turn it off by default.

If I would make endless looping the default behaviour I would therefore disable autoplaying by default.

Last edited by ber_t (2014-01-09 20:35:08)

Offline

#362 2014-01-09 20:31:04

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

LuX wrote:

@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...

Save a lot of time by not implementing quite complex features they do not need?

Offline

#363 2014-01-09 21:37:09

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

ikuchan wrote:

Is it possible to make sxiv read images from the standard input? Feh can do it, I think it's a pretty useful feature.

The Imlib library does not support loading images from memory. So sxiv would have to create a file, fill it with the data from stdin, make Imlib read this file and then delete it. I think that this can be more easily achieved by a simple shell script wrapper.

Offline

#364 2014-01-09 21:40:49

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

robertpeston wrote:

I just need to know how to setup the Esc key to exit.

This is not possible, because the Escape key is hardwired to reset the count prefix.

Offline

#365 2014-01-09 21:43:55

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

robertpeston wrote:

Thanks for the feedback

doggone wrote:

1) Write a little script using sed or awk.

And then call this script by modifying config.h?  As you say, there seems to be the possibility of that script going wrong (perhaps I'm just a nervous SED newbie).  I wanted to keep it as simple as possible.  Shame that SXIV doesn't have separate variables for path and filename.

I think that what you try to do is now pretty easy thanks to the new "exec/key-handler" script, which replaces the old "it_shell_cmd" and "it_open_with" commands.

Offline

#366 2014-01-09 21:52:13

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

robertpeston wrote:

Thumbnailing (or loading from cache) should start from the current image.

This is by design. Starting at the current image would make it impossible to achieve the same stability of the grid. I do not like the thumbnails to shift around when the ones above the current one get loaded.

Offline

#367 2014-01-09 22:27:14

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: sxiv - Simple image viewer written in C

likytau wrote:

* I could also implement 'go to random' command, except that sxiv seems to clip at the ends (eg. '694<Space>' in a 100-image list just goes to the 100th image, and the only way I have to know the filelist length is pregenerate the filelist.).

Could this not be achieved by two random numbers, the first for an amount of forward moves and the second for subsequent backward moves?

* Transform (rotate, flip) working on view rather than file. I'll still use Feh's file transforms to normalize the orientation of my scans and photos, but for everything else, view transforms are 100% the way to go!

You could also use the lossless jpegtran commands in "exec/key-handler" for this.

Offline

#368 2014-01-09 23:22:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: sxiv - Simple image viewer written in C

ber_t I love your work, but please use the edit button for multiple replies, rather than individual posts...

Also, thanks for being so staunch about "feature" creep: sxiv is very cool.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#369 2014-01-10 12:21:36

likytau
Member
Registered: 2012-09-02
Posts: 142

Re: sxiv - Simple image viewer written in C

ber_t wrote:
likytau wrote:

* I could also implement 'go to random' command, except that sxiv seems to clip at the ends (eg. '694<Space>' in a 100-image list just goes to the 100th image, and the only way I have to know the filelist length is pregenerate the filelist.).

Could this not be achieved by two random numbers, the first for an amount of forward moves and the second for subsequent backward moves?

I considered that. The reason that doesn't work is that the first move can hit the end of the list followed by the second one hitting the start of the list. As long as the command either a) has no knowledge of the length of the filelist, or b) can't access a command which goes N images through the list without wrapping, it is not mathematically possible. The most randomness reliably achievable with those constraints is .. 'randomly either go to next image or prev image'. Which is not useful smile

Thanks for the point about key-handler, I haven't checked out what's in that yet.

The key-handler design really, really impresses me BTW. The epitome of clean modular software design.

Last edited by likytau (2014-01-10 12:22:16)

Offline

#370 2014-01-22 06:44:02

ttz
Member
From: My Box
Registered: 2013-08-01
Posts: 56

Re: sxiv - Simple image viewer written in C

I'm still having trouble getting key-handler to work.

I git clone the repo and compile it; I create a folder "sxiv" in my home directory, and place "/exec/key-handler" in it. None of the keybindings seem to register at all. C-c doesn't copy the image filename, for example, to xsel. I've checked twice: the script is executable.

Any ideas?


Character shines in the great moments, but is polished in the little ones.

Offline

#371 2014-01-22 06:53:39

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: sxiv - Simple image viewer written in C

grep -i example .config/sxiv/exec/key-handler
# Example for $XDG_CONFIG_HOME/sxiv/exec/key-handler

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#372 2014-01-23 02:53:55

ttz
Member
From: My Box
Registered: 2013-08-01
Posts: 56

Re: sxiv - Simple image viewer written in C

jasonwryan wrote:
grep -i example .config/sxiv/exec/key-handler
# Example for $XDG_CONFIG_HOME/sxiv/exec/key-handler

Thanks. I hit myself in the face with a baseball bat after seeing this. I guess my sleep deprived eyes only saw "HOME".

Problem solved. Muchos gracias.


Character shines in the great moments, but is polished in the little ones.

Offline

#373 2014-01-30 23:16:15

dgz
Member
Registered: 2013-08-27
Posts: 98

Re: sxiv - Simple image viewer written in C

is it possible to set horizontal fit as default in config.h or (even better) via a startup option.

this is useful for viewing manga and comics.

Offline

#374 2014-01-31 09:55:05

sekret
Member
Registered: 2013-07-22
Posts: 288

Re: sxiv - Simple image viewer written in C

@dgz, is

static const scalemode_t SCALE_MODE = SCALE_FIT;

doing what you want?

Offline

#375 2014-01-31 13:43:02

dgz
Member
Registered: 2013-08-27
Posts: 98

Re: sxiv - Simple image viewer written in C

would that not fit the entire image, horizontally and vertically, to the window? i believe i have that set already. i want a horizontal fit, as in pressing 'e', by default.

Offline

Board footer

Powered by FluxBB