You are not logged in.
bloom wrote:#! /bin/sh
Use #!/bin/bash when you mean it.
I didn't (and I prefer to keep the space after the exclamation mark).
What lead you to that?
Very twisted and error-prone. Catch this:
if (( ! $? )) && [[ -n $destination ]]; then # Good enough if you don't need to support ~user or ~- expansions _destination=${destination/#\~/~} mv -t "$_destination" "$@" { printf '%s\n' "$destination"; cat "$move_places"; } | sort | ... > "$places_temp" mv -T "$places_temp" "$move_places" fi
Oh I see!
Would this syntax work with '/bin/sh'?
Is the '-T' option really necessary in the second 'mv'?
Offline
lolilolicon wrote:bloom wrote:#! /bin/sh
Use #!/bin/bash when you mean it.
I didn't (and I prefer to keep the space after the exclamation mark).
What lead you to that?
If you didn't realize that you were using bashism, apologies for misunderstanding your mistake. I should have simply put "You want #!/bin/bash here."
The space is irrelevant.
Very twisted and error-prone. Catch this:
if (( ! $? )) && [[ -n $destination ]]; then # Good enough if you don't need to support ~user or ~- expansions _destination=${destination/#\~/~} mv -t "$_destination" "$@" { printf '%s\n' "$destination"; cat "$move_places"; } | sort | ... > "$places_temp" mv -T "$places_temp" "$move_places" fi
Oh I see!
Would this syntax work with '/bin/sh'?
As I said, this parameter expansion syntax is bashism that you already are using. See http://mywiki.wooledge.org/Bashism
BTW, in case you're not aware, /bin/sh is a symlink to bash in Arch. Although when bash is invoked as sh, it is meant to behave more like sh, it is not.
Is the '-T' option really necessary in the second 'mv'?
Not really necessary but being explicit about what you mean is never a bad thing.
JFTR, I don't apologize for being arrogant once in a while.
This silver ladybug at line 28...
Offline
I am going to release version 1.0 early next week.
I won't have much time to work on sxiv in the future. So, it would be great, if the users of the git-version could look for issues and report them.
Thanks for using sxiv and for all your feedback.
Offline
ber_t, I was just looking into your Makefile. Question: What do you think about this patch
diff -paur sxiv/Makefile sxiv-build/Makefile
--- sxiv/Makefile 2011-11-01 23:58:48.173359004 +0100
+++ sxiv-build/Makefile 2011-11-02 00:00:19.116654374 +0100
@@ -1,8 +1,8 @@
VERSION = git-20111101
CC = gcc
-CFLAGS = -ansi -Wall -pedantic -O2
-LDFLAGS =
+CFLAGS += -ansi -Wall -pedantic
+LDFLAGS +=
LIBS = -lX11 -lImlib2
PREFIX = /usr/local
so it's up to the user to decide, which FLAGS are being used?
Offline
I want the Makefile to strictly adhere to the POSIX standard. There are other possibilities to overwrite the macros defined in the Makefile, apart from the (gnu-like) "+=", please see http://pubs.opengroup.org/onlinepubs/00 … 4_84_13_04 for more information.
Offline
I managed to code XEmbed support today. So here is the patch:
http://www.hawski.com/suckless/sxiv/000 … tion.patch
Last edited by hadrianw (2011-11-05 22:47:06)
Gentoo user here
Offline
I changed the SCALE_MODE to SCALE_FIT in the config.h. I know that this behavior is controllable with -d/-s/-Z/-z. But is it possible to bind a key to toggle between those two options?
edit: Simple solution: 'w' = SCALE_FIT, '=' almost = SCALE_DOWN => perfect!
Last edited by Army (2011-11-07 15:58:54)
Offline
I'm finding that with v 1.0, when I open a large image and then press '=' to zoom to 100%, and then 'W' to resize the window, the image is offset, not matched up with the window. Hitting '=' a second time shifts the image into the proper position. This is new with v 1.0, never had this happen with previous versions.
Offline
I'm finding that with v 1.0, when I open a large image and then press '=' to zoom to 100%, and then 'W' to resize the window, the image is offset, not matched up with the window. Hitting '=' a second time shifts the image into the proper position. This is new with v 1.0, never had this happen with previous versions.
I have the same problem.
Offline
Great little viewer, switching from gliv, Thanks!
karol wrote:qiv hides the mouse cursor if I'm not moving it while viewing the pictures, sxiv keeps the cursor visible at all times. Is it the intended behaviour? Do you plan to change it? ;P Is there an option I can use to hide the cursor (other than moving it to the bottom right corner of the screen)?
Never thought of that, but implemented it right away. Can be found in the current head...
This could have been left to programs like unclutter if you wanted to be more suckless.
Offline
This could have been left to programs like unclutter if you wanted to be more suckless.
+1
Offline
ibrunton wrote:I'm finding that with v 1.0, when I open a large image and then press '=' to zoom to 100%, and then 'W' to resize the window, the image is offset, not matched up with the window. Hitting '=' a second time shifts the image into the proper position. This is new with v 1.0, never had this happen with previous versions.
I have the same problem.
Should be fixed in the current head.
Offline
N30N wrote:This could have been left to programs like unclutter if you wanted to be more suckless.
+1
Totally disagreed.
This silver ladybug at line 28...
Offline
I modified the bash script that floats around here with the assistance of some really helpful folks at #bash.
In short,
./sx.sh 4
Pictures by ctime: 1 2 3 4 5 6 7 8
You end up here: ^
Forgive my weak scripting. Might need more testing.
#!/bin/bash
shopt -s nullglob
if [[ ! -f $1 ]]; then
echo "$0: first argument is not a file" >&2
exit 1
fi
file=$(basename -- "$1")
dir=$(dirname -- "$1")
arr=()
z=0 #file number we should be taken to
st=0 #stop counting flag
shift #a button on the keyboard
cd -- "$dir"
while read -rd '' _ path; do
arr+=("$path")
if [ "$st" -eq "0" ]; then
let z=z+1
[[ "$path" == "./$file" ]] && st=1
fi
done < <(find . -maxdepth 1\
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' \)\
-type f\
-printf '%C@ %p\0'\
| sort -znr)
exec sxiv "$@" -n "$z" -- "${arr[@]}"
Last edited by MadCatMk2 (2011-11-24 00:20:08)
Offline
This viewer is great!!! It's exactly what I had been looking for in the past ~5 years.
I'm a big fan!
Daan
Offline
Thank you for the best image viewer!
I have a feature request
I would like the current image number to be set as a environment variable, just like $SXIV_IMG.
I tried to do this myself, but failed.
The code you use to set the environment variable $SXIV_IMG is:
setenv("SXIV_IMG", files[n].path, 1)
So I thought this would work, but it didn't:
setenv("SXIV_NUMBER", n, 1)
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?
Last edited by El_Belgicano (2012-06-16 19:55:07)
Offline
So I thought this would work, but it didn't:
setenv("SXIV_NUMBER", n, 1)
Try something like:
char buffer[5]; /* increase size of buffer, if your number is more than 4 digits */
memset(buffer, 0, sizeof(buffer));
snprintf(buffer, sizeof(buffer)-1, "%d", n);
setenv("SXIV_NUMBER",buffer,1);
Last edited by Cloudef (2012-06-17 21:47:27)
Offline
Speaking of script, @MadCatMk2 does it work with path that contain [blablabla] ?
Sorry I didn't try your script, just want to ask first.
Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.
Offline
Speaking of script, @MadCatMk2 does it work with path that contain [blablabla] ?
Sorry I didn't try your script, just want to ask first.
It should, but testing it should convince you better. ranger has amazing support for sxiv these days so I don't use it anymore.
Edit: Take a look at this script as well right here: https://bbs.archlinux.org/viewtopic.php … 1#p1078381
Last edited by MadCatMk2 (2012-06-17 09:22:20)
Offline
I just started using this program (amazing application, I love it!). I read this thread sometimes before I used this and somewhere I read that the developer would look into setting the background with sxiv. I don't see this option yet so I wondered if it's going to happen or if it has been dropped (seeing the dev adheres to suckless very strictly - which is good!)
What do you use to set the background now? I'd like to get rid of feh now that I have sxiv.
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
I just started using this program (amazing application, I love it!). I read this thread sometimes before I used this and somewhere I read that the developer would look into setting the background with sxiv. I don't see this option yet so I wondered if it's going to happen or if it has been dropped (seeing the dev adheres to suckless very strictly - which is good!)
What do you use to set the background now? I'd like to get rid of feh now that I have sxiv.
hsetroot or another of the many alternatives
Offline
ber_t, what do you think about an option in the config.h to configure, if the bar should be shown by default or not? Most of the time I don't need the bar, so I hide it with "b", it's a bit annoying.
Offline
ber_t, what do you think about an option in the config.h to configure, if the bar should be shown by default or not? Most of the time I don't need the bar, so I hide it with "b", it's a bit annoying.
Perhaps another workound: use -b option when you open it. You can create a script or set this in your WM's keyboard section
Last edited by Unia (2012-06-18 20:56:37)
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
Is it correct the slideshow option has been removed? I was going through the manpage to edit the shortcuts to match with those I changed in config.h and I came across the slideshow ones. I don't have these in my config.h though and also the files on GitHub don't show anything about it. I'm using the git version.
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