You are not logged in.
Great stuff, replaced feh completely here too.
Would it be possible to have the package add sxiv to the mimeapps list automatically, to avoid that people have to do this manually?
ᶘ ᵒᴥᵒᶅ
Offline
I actually have two final suggestions, one of which I noticed earlier; the first is another enhancement to the recursive flag which would make it work when opening an image directly:
$ ls /path/to/ 001.jpg 002.jpg 003.jpg 004.jpg 005.jpg $ sxiv -r /path/to/003.jpg
^ Which would order all five images and focus on 003.jpg.
So basically what you're asking is to start at a specific image. I somewhat agree with this suggestion -- useful for you manga readers to start at a given manga page and (many) people that tend to open a specific image in a folder (e.g. a photo) and expect to be able to go backwards or forwards from there -- but not as an extension of the -r flag as I find it fine as it is.
Perhaps another flag (-l ?) to load all images (in the order they're found) in the same directory as the one being displayed? However I don't know how much this deviates from the suckless approach. The only workaround I can think of out of the top off my head is something like
sxiv [options] image.jpg *
but it would load image.jpg twice and pressing next would display the first image found on the folder, which isn't practical.
What are your thoughts on this ber_t, think it's doable?
On another note, I see litemotiv's point, as more and more people pick sxiv having it at least as an option on the open with dialog seems like a logic step, but then again most people who adopt(ed) sxiv probably have lightweight desktops and usually those people know their way around Arch, and therefore, how to do it -- which isn't much of a hassle to be honest.
Offline
Would it be possible to have the package add sxiv to the mimeapps list automatically, to avoid that people have to do this manually?
I do not want to install a DE just to write a .desktop file for sxiv and mess around with the mime* stuff. But if someone provides a .desktop file and comes up with some decent commands to alter the mime* files, then I would not hesitate including them in the sxiv pkg.
Perhaps another flag (-l ?) to load all images (in the order they're found) in the same directory as the one being displayed? However I don't know how much this deviates from the suckless approach. The only workaround I can think of out of the top off my head is something like
sxiv [options] image.jpg *
but it would load image.jpg twice and pressing next would display the first image found on the folder, which isn't practical.
I think this is too cumbersome.
If you forget to give an argument like *.jpg you will certainly also forget the -l option.
What exactly is "the order they're found"? From a programmers perspective, that's the same listing as `find' would produce, but this is hardly the same order a user would expect.
What if multiple images from different folders are given on the command line?
I can however add a new option, that defines the number of the image that sxiv starts on. This will also allow advanced users to write a small script wrapper for reading their comics. Maybe something like: given the base of all file names and the number of the image to start with, open all base* images with sxiv and hand over the number argument to it...
Offline
I think this is too cumbersome.
If you forget to give an argument like *.jpg you will certainly also forget the -l option.
What exactly is "the order they're found"? From a programmers perspective, that's the same listing as `find' would produce, but this is hardly the same order a user would expect.
What if multiple images from different folders are given on the command line?
Indeed, thought I'd edited this post, was too tired at such a late hour. Scrap what I said.
I can however add a new option, that defines the number of the image that sxiv starts on. This will also allow advanced users to write a small script wrapper for reading their comics. Maybe something like: given the base of all file names and the number of the image to start with, open all base* images with sxiv and hand over the number argument to it...
That's a possibility I'm comfortable with. Would be enough to make a wrapper script to find the number of a given image name among the files to be loaded and have sxiv start there.
On another note, I've noted something while using full screen on my openbox desktop, if I press Alt+Tab to switch to another application sxiv loses focus but still stays on top of every other application. Is this the intended behavior?
Offline
litemotiv wrote:Would it be possible to have the package add sxiv to the mimeapps list automatically, to avoid that people have to do this manually?
I do not want to install a DE just to write a .desktop file for sxiv and mess around with the mime* stuff. But if someone provides a .desktop file and comes up with some decent commands to alter the mime* files, then I would not hesitate including them in the sxiv pkg.
Here are a few lines from ~/.local/share/applications/mimeapps.list
image/jpeg=sxiv.desktop;
image/png=sxiv.desktop;
image/gif=sxiv.desktop;
And a simple xsiv.desktop
[Desktop Entry]
Type=Application
Name=sxiv
Exec=sxiv %f
NoDisplay=true
ᶘ ᵒᴥᵒᶅ
Offline
ber_t wrote:I can however add a new option, that defines the number of the image that sxiv starts on. This will also allow advanced users to write a small script wrapper for reading their comics. Maybe something like: given the base of all file names and the number of the image to start with, open all base* images with sxiv and hand over the number argument to it...
That's a possibility I'm comfortable with. Would be enough to make a wrapper script to find the number of a given image name among the files to be loaded and have sxiv start there.
Okay, I'll add this new option soon.
On another note, I've noted something while using full screen on my openbox desktop, if I press Alt+Tab to switch to another application sxiv loses focus but still stays on top of every other application. Is this the intended behavior?
This also happens in dwm. This behaviour is not intended. The whole fullscreen mode depends on the window manager. The only thing sxiv does for toggling its fullscreen mode is, that it tells the window manager that it wants to get into or out of fullscreen mode. All the other things--like handling focus when an application is in fullscreen mode--are up to the wm...
Here are a few lines from ~/.local/share/applications/mimeapps.list
image/jpeg=sxiv.desktop; image/png=sxiv.desktop; image/gif=sxiv.desktop;
So I can easily just cat these lines into mimeapps.list if the file already exists, and that's it? Do these lines make sxiv the default application for the mentioned file types? I've somewhere read, that supported file types--an application wants to become the default app for--have to be listed in its .desktop file. Sorry, I'm a noob regarding mime stuff and don't have that much time at the moment.
I only want to make it as easy as possible to open images with sxiv from inside a DE. I don't want to make it the default app, that's something the user definitely has to do by himself.
Offline
EiyuuZack wrote:On another note, I've noted something while using full screen on my openbox desktop, if I press Alt+Tab to switch to another application sxiv loses focus but still stays on top of every other application. Is this the intended behavior?
This also happens in dwm. This behaviour is not intended. The whole fullscreen mode depends on the window manager. The only thing sxiv does for toggling its fullscreen mode is, that it tells the window manager that it wants to get into or out of fullscreen mode. All the other things--like handling focus when an application is in fullscreen mode--are up to the wm...
In dwm this issue was fixed in the last commit in development version (the patch describe similar issue with fullscreen mplayer but also fix similar fullscreen issues with other programs, including sxiv (I have checked)).
Last edited by Raziel23 (2011-04-29 14:15:03)
Offline
In dwm this issue was fixed in the last commit in development version (the patch describe similar issue with fullscreen mplayer but also fix similar fullscreen issues with other programs, including sxiv (I have checked)).
Are you referring to changeset 7a60bff116c7? This patch prevents the fullscreen window from getting resized when changing the selected tagset. It has nothing to do with preventing a focus change to another client when the current one is in fullscreen mode. I've asked Anselm on #suckless, if he intends to forbit this behaviour and he denied it, because this way pop-up windows of the fullscreen client would never get the focus.
Offline
You're right, this patch is not referring to switch between clients focus when one of them is in fullscreen mode (my fault ). On the other hand when I have multiple running programs with fullscreen mode in the same tag, I have the opportunity to change between them (for example multiple running mplayer in the same tag) and this patch fixed focus behavior of mplayer (when I switch between them, not only switch between tags).
Offline
Okay, I'll add this new option soon.
Much appreciated.
litemotiv wrote:Here are a few lines from ~/.local/share/applications/mimeapps.list
image/jpeg=sxiv.desktop; image/png=sxiv.desktop; image/gif=sxiv.desktop;
So I can easily just cat these lines into mimeapps.list if the file already exists, and that's it? Do these lines make sxiv the default application for the mentioned file types? I've somewhere read, that supported file types--an application wants to become the default app for--have to be listed in its .desktop file. Sorry, I'm a noob regarding mime stuff and don't have that much time at the moment.
I only want to make it as easy as possible to open images with sxiv from inside a DE. I don't want to make it the default app, that's something the user definitely has to do by himself.
If I recall correctly, those lines would add an "Open With 'sxiv'" entry for those file types in file managers i.e. nautilus which uses gnome-open or Thunar (exo-open), which both check for candidate applications in mimeapps.list. Since sxiv.desktop is the only value (candidate) it would effectively make it the default application. However that alone won't make it the default application to be called by other (DE independent) programs like chromium which use xdg-open. That's where mimeinfo.cache and the MimeType entry in .desktop files come in. By specifying file types on .desktop files and running (post-install or manually)
update-desktop-database
to check what .desktop files (with a MimeType entry) claim to be able to handle, the mimeinfo.cache file is updated (or created) with the candidate(s) for a given file type. This file is, in turn, what xdg-open checks when opening a file, picking the first value (candidate).
Putting it simple, if you don't wan't to force sxiv as the new default, just create a .desktop file with a MimeType entry specifying what image types you want sxiv to claim to open, and let the user decide whether he wants to make an association or not. Of course it would be nice to remind users at installation that if they want chromium, etc. to be able to open images directly with sxiv then they have to run the above command.
Offline
litemotiv wrote:Here are a few lines from ~/.local/share/applications/mimeapps.list
image/jpeg=sxiv.desktop; image/png=sxiv.desktop; image/gif=sxiv.desktop;
So I can easily just cat these lines into mimeapps.list if the file already exists, and that's it? Do these lines make sxiv the default application for the mentioned file types? I've somewhere read, that supported file types--an application wants to become the default app for--have to be listed in its .desktop file. Sorry, I'm a noob regarding mime stuff and don't have that much time at the moment.
I only want to make it as easy as possible to open images with sxiv from inside a DE. I don't want to make it the default app, that's something the user definitely has to do by himself.
Yes, i understand. Here is an example with multiple registered applications:
image/png=feh.desktop;sxiv.desktop;
Both are not the default application, i'm actually not sure where that is set, they are just available in the context menus. So the proper way i guess would be to check if there is a image/png line, and if there is only append instead of creating.
Edit: didn't see EiyuuZack's reply.
Edit 2: apparently you can also add this section to mimeapps.list:
[Default Applications]
image/jpeg=sxiv.desktop
image/png=sxiv.desktop
image/gif=sxiv.desktop
If you wanted to make it the defaullt application.
Last edited by litemotiv (2011-04-30 10:31:15)
ᶘ ᵒᴥᵒᶅ
Offline
Released version 0.8.1
New:
- Bug fix: Correctly center image when zooming
- Bug fix: Fullscreen handling, it now works in some broken window managers too
- Added a .desktop file, the rest of mime-handling has to be done by the user
Offline
Released version 0.8.1
- Bug fix: Fullscreen handling, it now works in some broken window managers too
Just reporting it's working flawlessly on my Openbox desktop, thanks for the fix.
...apparently you can also add this section to mimeapps.list:
[Default Applications] image/jpeg=sxiv.desktop image/png=sxiv.desktop image/gif=sxiv.desktop
If you wanted to make it the defaullt application.
Is that so? That used to be the contents of the defaults.list file, which is now gone from my ~/.local/share/applications/ folder ever since I deleted all files in there and remade the associations through Thunar's Open With and update-desktop-database. From my understanding that file is either DE dependent or deprecated because I still have my default applications opening correctly using only mimeapps.list -- [Added Associations] section only --, mimeinfo.cache and the self-made .desktop files.
Offline
sxiv is now in [community]
https://bbs.archlinux.org/viewtopic.php … 89#p937489
Offline
Awesome application, pretty fast too
If possible can you implement browse function just like in qiv, it's similar to recursive minus all children directory just the current directory. So I can navigate all picture in the current directory only.
Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.
Offline
Awesome application, pretty fast too
If possible can you implement browse function just like in qiv, it's similar to recursive minus all children directory just the current directory. So I can navigate all picture in the current directory only.
Wouldn't " sxiv * " do that?
Offline
igndenok wrote:Awesome application, pretty fast too
If possible can you implement browse function just like in qiv, it's similar to recursive minus all children directory just the current directory. So I can navigate all picture in the current directory only.Wouldn't " sxiv * " do that?
Partially, cause you would want to start viewing at your chosen picture, and not at the first picture from that folder.
Offline
lchr wrote:igndenok wrote:Awesome application, pretty fast too
If possible can you implement browse function just like in qiv, it's similar to recursive minus all children directory just the current directory. So I can navigate all picture in the current directory only.Wouldn't " sxiv * " do that?
Partially, cause you would want to start viewing at your chosen picture, and not at the first picture from that folder.
I'm sorry that my post didn't clear enough, but just like archman-cro said. If I have picture files like this
~/Picture $ ls *.jpg
00.jpg
01.jpg
02.jpg
03.jpg
...
10.jpg
I want to browse Picture folder but start with 02.jpg as the first picture not 00.jpg, maybe using sxiv like this
sxiv -b ~/Picture/02.jpg
Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.
Offline
I want to browse Picture folder but start with 02.jpg as the first picture not 00.jpg, maybe using sxiv like this
sxiv -b ~/Picture/02.jpg
What does '-b' do? I get sxiv: invalid option -- 'b'.
That will search only the pics you specified (02.jpg), so using 'foo*' will let you view only those starting with 'foo'.
Offline
Isn't there a feh script for that?
https://wiki.archlinux.org/index.php/Fe … e_Launcher
Haven't tested it, but it should work with just replacing feh with sxiv.
Offline
@karol: from earlier my post, I wrote this "maybe using sxiv like this"
Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.
Offline
Isn't there a feh script for that?
https://wiki.archlinux.org/index.php/Fe … e_Launcher
Haven't tested it, but it should work with just replacing feh with sxiv.
I can confirm that this works.
Offline
Procyon wrote:Isn't there a feh script for that?
https://wiki.archlinux.org/index.php/Fe … e_Launcher
Haven't tested it, but it should work with just replacing feh with sxiv.
I can confirm that this works.
Great. This script renders the -b/-l wishes useless. Also, I've forgotten the number option, that EiyuuZack has wished, so I'm glad this script also works around his issue -- both issues are actually the same.
Offline
It kinda works for me: on the first go the script will display only the pics that match glob (but for some reason will skip the first one) and later ... some files that match the glob and then the rest.
Running '/path/to/script 1*' on
00
01
02
10
11
20
21
22
will show
11
12
10
11
12
20
21
22
00
01
02
Offline
ber_t, would you consider adding the original resolution/depth of the image to the title? Something like this:
<61% - 1024x768@32bpp>
Or perhaps combine them all:
<84% - 800x600@8bpp - 19.72K>
ᶘ ᵒᴥᵒᶅ
Offline