How to load gtksee in automatic photo presentation?
How to load gtksee in automatic photo presentation?
Hi all,
I was just wondering if it was possible to automaticly open a picture with the "presentation" mode of GTKsee, so we have a windows xp's equivalent.
It would be great to add the fullscreen and fit into screen -i and -s options.
I tried the set run action with those options but gtksee always open in the last directory and doesn't open in full and fit screen.
thanks a lot if anyone knows how to do this!
Guillaume
I was just wondering if it was possible to automaticly open a picture with the "presentation" mode of GTKsee, so we have a windows xp's equivalent.
It would be great to add the fullscreen and fit into screen -i and -s options.
I tried the set run action with those options but gtksee always open in the last directory and doesn't open in full and fit screen.
thanks a lot if anyone knows how to do this!
Guillaume
[color=blue]Dumbledore: "The evidence of the Dark Lord's return is incontrovertible"[/color]
IBM X31 - Puppy 2.16 Hard disk install with EZpup
IBM X31 - Puppy 2.16 Hard disk install with EZpup
Good idea.
Rather than using GTKSee, why not just call qiv directly.
For a start change the rox MIME type action for images to something likeThere are at least two problems with this:
1. fairly easily to solve, my simple example tries to view every file in the directory
2. I think this will be more tricky. At the moment my example orders the files alphabetically and always starts at the top regardless of which file you clicked on. You can use the -F switch to load the list of files to view from a file. You could order this list so that it starts with the file clicked and then continues down the alphabet and wraps to the beginning of the alphabet. What I definitely don't know how to do is to ask rox what criteria the files shown in the window are currently ordered by. You could just assume alphabetic.
the qiv -f fullscreen option might be a problem for newbies as it takes a small amount of imagination to get out of (ESC or q). If you remove the -f you still get the window maximised but with decoration which might be better.
Somehow it would be good to give the user some instructions. The only way I can see to do this inside qiv is for the user to invoke fullscreen (f) and then (F1 or ?). Maybe a small window with a question mark that is always on top could be used to open some instructions.
I tend not to use GTKSee because it is quite slow, rox with big thumbnails is faster at creating thumbnails and calling qiv from the command line gives easier control over slideshows.
Rather than using GTKSee, why not just call qiv directly.
For a start change the rox MIME type action for images to something like
Code: Select all
exec qiv -fmsd 2 `dirname "$1"`/*
1. fairly easily to solve, my simple example tries to view every file in the directory
2. I think this will be more tricky. At the moment my example orders the files alphabetically and always starts at the top regardless of which file you clicked on. You can use the -F switch to load the list of files to view from a file. You could order this list so that it starts with the file clicked and then continues down the alphabet and wraps to the beginning of the alphabet. What I definitely don't know how to do is to ask rox what criteria the files shown in the window are currently ordered by. You could just assume alphabetic.
the qiv -f fullscreen option might be a problem for newbies as it takes a small amount of imagination to get out of (ESC or q). If you remove the -f you still get the window maximised but with decoration which might be better.
Somehow it would be good to give the user some instructions. The only way I can see to do this inside qiv is for the user to invoke fullscreen (f) and then (F1 or ?). Maybe a small window with a question mark that is always on top could be used to open some instructions.
I tend not to use GTKSee because it is quite slow, rox with big thumbnails is faster at creating thumbnails and calling qiv from the command line gives easier control over slideshows.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
getting betterOne thing I don't like about this is that the line to start qiv contains an entry for each file to display. Presumably if your directory is big enough the command line will overflow.
I tried to overcome this using -F to load all the files in /tmp/slideshow but then qiv sorts them alphabetically and I can't find a switch to turn it off.
Code: Select all
#! /bin/sh
#exec defaultpaint "$1"
cd `dirname "$1"`
FILE=`basename $1`
ls | sed -n '/'$FILE'/,$p' > /tmp/slideshow
ls | sed -n '1,/'$FILE'/p' >> /tmp/slideshow
FILES=`cat /tmp/slideshow`
exec qiv -msd 2 $FILES
I tried to overcome this using -F to load all the files in /tmp/slideshow but then qiv sorts them alphabetically and I can't find a switch to turn it off.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
Thanks a lot HairyWill!
I will try this tonight on my puppy laptop as I'm at work now. I thought of gtksee as I didn't know qiv. But any idea is welcomed, as I don't have internet at home and won't be able to post back until tomorrow!
I will try this tonight on my puppy laptop as I'm at work now. I thought of gtksee as I didn't know qiv. But any idea is welcomed, as I don't have internet at home and won't be able to post back until tomorrow!
[color=blue]Dumbledore: "The evidence of the Dark Lord's return is incontrovertible"[/color]
IBM X31 - Puppy 2.16 Hard disk install with EZpup
IBM X31 - Puppy 2.16 Hard disk install with EZpup
Re: Load gtksee in automatic photo presentation
This is essentially what I have done.gdemonta wrote:I was just wondering if it was possible to automaticly open a picture with the "presentation" mode of GTKsee, so we have a windows xp's equivalent.
It would be great to add the fullscreen and fit into screen -i and -s options
Code: Select all
echo 'exec defaultImageHandler "$@"'>/root/Choices/MIME-types/image
echo 'gtksee -i -f "$1"'>/usr/local/bin/defaultImageHandler
The creation of defaultimagehandler is a good point
this makes it much easier to modify the action for a number of similar mime types.
I found that I had to remove the more specific mime type entries such as image_jpeg image_x-png to allow the the generic type of image to be recognised.
This allows a two tier approach with a general handler for images and possibly a different one for some specific mime types.
this makes it much easier to modify the action for a number of similar mime types.
I found that I had to remove the more specific mime type entries such as image_jpeg image_x-png to allow the the generic type of image to be recognised.
This allows a two tier approach with a general handler for images and possibly a different one for some specific mime types.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
Hi Hairy Will and Getnikar,
I tried the three solutions you posted:
- Hairy Will 1st: worked very well, except when the directory had a space in it (mine was "Mes documents") qiv couldn't open the pistures in it.
- Hairy Will 2nd: didn't worked, qiv tried to open pictures in the MIME types folder!
- Getnikar: Worked very well, except the lack of speed Hairy Will had foreseen, and the fact that you cannot actually do slideshow, you can only click on each picture, but it's a start!
But thanks a lot, by tweaking it a little more, maybe I will succeed in having the perfect slideshow!
I tried the three solutions you posted:
- Hairy Will 1st: worked very well, except when the directory had a space in it (mine was "Mes documents") qiv couldn't open the pistures in it.
- Hairy Will 2nd: didn't worked, qiv tried to open pictures in the MIME types folder!
- Getnikar: Worked very well, except the lack of speed Hairy Will had foreseen, and the fact that you cannot actually do slideshow, you can only click on each picture, but it's a start!
But thanks a lot, by tweaking it a little more, maybe I will succeed in having the perfect slideshow!
[color=blue]Dumbledore: "The evidence of the Dark Lord's return is incontrovertible"[/color]
IBM X31 - Puppy 2.16 Hard disk install with EZpup
IBM X31 - Puppy 2.16 Hard disk install with EZpup
use of double quotes helps to solve the problem with spaces in the directory name but I haven't worked out how to cope with spaces in the image filenames.
I'm not sure if it is me or qiv that it is the problem. I've tried this Which should escape the spaces but doesn't appear to work, it still considers the spaces as separators between the files . If I use ps to check the command that has been called I see If I try running this from the prompt it works
<edit id="1">removed a couple of nasty spurious quotes that got into the sed lines when I was retyping</edit>
Code: Select all
#! /bin/sh
cd "`dirname "$1"`"
FILE=`basename $1`
TAIL=`ls | sed -n '/'$FILE'/,$p'`
HEAD=`ls | sed -n '1,/'$FILE'/p'`
exec qiv -msd 2 $TAIL $HEAD
Code: Select all
#! /bin/sh
cd "`dirname "$1"`"
FILE=`basename $1`
TAIL=`ls | sed -n '/'"$FILE"'/,$p' | sed 's/ /\\\ /'`
HEAD=`ls | sed -n '1,/'"$FILE"'/p' | sed 's/ /\\\ /'`
exec qiv -msd 2 $TAIL $HEAD
Code: Select all
qiv -msd 2 picture\ one.jpg picture\ two.jpg
<edit id="1">removed a couple of nasty spurious quotes that got into the sed lines when I was retyping</edit>
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
Bomb proof?
Code: Select all
#! /bin/sh
cd "`dirname "$1"`"
FILE=`basename $1`
TAIL=`ls | sed -n '/'"$FILE"'/,$p' | sed 's/ /\\\ /'`
HEAD=`ls | sed -n '1,/'"$FILE"'/p' | sed 's/ /\\\ /'`
echo '#!/bin/sh' > /tmp/slideshow
echo 'exec qiv -msd 2' $TAIL $HEAD >> /tmp/slideshow
chmod 700 /tmp/slideshow
exec /tmp/slideshow
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
No not bombproof. You need to parse the parameter line in a loop: something like
There are lots of examples around in shell scripts that give you the idea on how to do this .
Thanks for the info on qiv. I did not know it was there. It seems faster than gtksee, so I shall look at switching.
On a related note:
These apps that need wrappers need the PATH to be reversed. Puppies PATH of /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R7/bin:/root/my-applications/bin is pretty much the reverse of what most unix/linux setup use. With the PATH set to something more like /root/my-applications/bin:/usr/local/bin:/usr/X11R7/bin:/usr/sbin:/sbin:/usr/bin:/bin you should be able to put a wrapper into your own bin to override one in /usr/local/bin, which itself might be a wrapper or alternative for an executable further down the stack. As far as I can see Puppies setup should be changed.[/code]
Code: Select all
while "$1" ; do
VFiles="$VFiles $1" ; shift
done
Thanks for the info on qiv. I did not know it was there. It seems faster than gtksee, so I shall look at switching.
On a related note:
These apps that need wrappers need the PATH to be reversed. Puppies PATH of /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R7/bin:/root/my-applications/bin is pretty much the reverse of what most unix/linux setup use. With the PATH set to something more like /root/my-applications/bin:/usr/local/bin:/usr/X11R7/bin:/usr/sbin:/sbin:/usr/bin:/bin you should be able to put a wrapper into your own bin to override one in /usr/local/bin, which itself might be a wrapper or alternative for an executable further down the stack. As far as I can see Puppies setup should be changed.[/code]
ps Add "'s in as shown below?
Code: Select all
...
FILE="`basename $1`"
TAIL="`ls | sed -n '/'"$FILE"'/,$p' | sed 's/ /\\\ /'`"
HEAD="`ls | sed -n '1,/'"$FILE"'/p' | sed 's/ /\\\ /'`"
Re: Load gtksee in automatic photo presentation
Based on feedback above, this is better code for the /usr/local/bin/defaultImageHandler bit:Getnikar wrote:This is essentially what I have done.Then, when you are in rox and click on any file whose mime-type is an image, gtksee shows the image full screen. Hit [Esc] to exit.Code: Select all
echo 'exec defaultImageHandler "$@"'>/root/Choices/MIME-types/image echo 'gtksee -i -f "$1"'>/usr/local/bin/defaultImageHandler
Code: Select all
#!/bin/bash
[ "$2" ] && vS=s
gtksee -if$vS "$@"
I also added the defaultImageHandler wrapper into the OpenWith directory. This is done in the rox gui, or run this comand
Code: Select all
ln -s ../../../../usr/local/bin/defaultImageHandler /root/.config/rox.sourceforge.net/OpenWith
BTW. When in gtksee fullscreen, again try [right mouse button] and select menub options to stop the slideshow, and/or exit full screen. From there you can select a 'Browse' toolbar icon to browse the directory where the files are.
http://www.murga-linux.com/puppy/viewto ... 226#125226
GuestToo wrote:you can right click any file and click Send To (or Open With) ... then click Customise
basically, you can put a symlink to a program in the Send To folder ... or you can copy or create a program, for example, a script, in the Send To folder
if you put a directory or symlink to a directory in the Send To folder, it will appear as a sub menu in the Send To menu
you can open the Send To menu quickly by right clicking a file or directory while holding down the shift key
another trick (nothing to do with the Send To folder): you can open multiple items by selecting the items and dragging them to the Home icon on the desktop ... for example, you could select 4 or 5 text files or mp3 files etc etc in /root and drag them to the Home icon
Last edited by HairyWill on Fri 29 Jun 2007, 12:11, edited 1 time in total.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
Bomb proof usually gets a reaction even if it is used with a question mark.
Talking of the Open With menu qiv is in there already though of course it is not clear what it does, may renaming the link to "qiv-slideshow" would be good. Its lack of instruction are a problem and as it it just a symling to qiv with no parameters it does not reduce images to fit the screen until you hit the magic "m". Gtksee is much stronger in this respect. so works better for the newbie.
I tried viewing 1000 images from a fairly slow samba share, qiv took a few seconds to start gtksee took over a minute.
Thinking about it further clicking on a single file should not launch a slide show and qiv is the fastest single image viewer.
Getnikar thanks for the pointers on parameter parsing I haven't done that before it didn't work for me until I put square brackets around the test
My original program was only expecting one parameter anyway, a single file, so it wasn't a problem I think.
Thanks for pointing out the missing quotes.
Talking of the Open With menu qiv is in there already though of course it is not clear what it does, may renaming the link to "qiv-slideshow" would be good. Its lack of instruction are a problem and as it it just a symling to qiv with no parameters it does not reduce images to fit the screen until you hit the magic "m". Gtksee is much stronger in this respect. so works better for the newbie.
I tried viewing 1000 images from a fairly slow samba share, qiv took a few seconds to start gtksee took over a minute.
Thinking about it further clicking on a single file should not launch a slide show and qiv is the fastest single image viewer.
Getnikar thanks for the pointers on parameter parsing I haven't done that before it didn't work for me until I put square brackets around the test
Code: Select all
while [ "$1" ] ; do
VFiles="$VFiles $1" ; shift
done
Thanks for pointing out the missing quotes.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
Square brackets *are* the test. See 'man bash': '[ ..]' is alternative coding for 'test'.HairyWill wrote:until I put square brackets around the test
Here is my new defaultImagehandler
Code: Select all
#!/bin/bash
if [ "$2" ] ; then
qiv -fmtps "$@"
else
if [ "$1" ] && [ -d "$1" ] ; then
qiv -fmtps "$1"/*
else
qiv -fmtp "$1"
fi
fi
Thanks for the heads-up on qiv being already in OpenWith. Itworks well as is, to show single files at their original size. Of course, as you mentioned, hotkeys switch qiv to alternative views anyway, irrespective of how initially started. Either way, and with gtksee as well, Puppy has adequate image handling, although for finding an image quickly I still miss the iconised thumbnails that Ubuntu's Nautilus provides. Then again I am sure that that comes at a cost of overhead, so in the interest of maintaining a lean Puppy I probably would not want that sort of thing in Puppy.
nice, very neat, works well for me.
Playing devils advocate, because I want it both ways gtksee filters out the files that aren't images.
And whilst I'm being unreasonable qiv's source needs hacking so that the information bar also says "help(F1)"
Playing devils advocate, because I want it both ways gtksee filters out the files that aren't images.
And whilst I'm being unreasonable qiv's source needs hacking so that the information bar also says "help(F1)"
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
Rox does thumbnails, at maximum they are about 100 pixels across. Is that not what you want?Getnikar wrote:although for finding an image quickly I still miss the iconised thumbnails that Ubuntu's Nautilus provides
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]