xlideshow-0.0.1

A home for all kinds of Puppy related projects
Message
Author
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

xlideshow-0.0.1

#1 Post by 01micko »

Zigbert said that with clever use of xli that we might be able to come up with a slideshow widget for Pwidgets. Well, I had a go, and I have limited (ie; nil) coding skill. :mrgreen:
With the help of some well constructed code by MU I have come up with a script that at least shows some small (resized) pictures that you might have in your system.

For interested persons; Please add your ideas, Please edit my code. This is for the Puppy community, not for me. If someone wants to take over, by all means do it! I have got the ball rolling! :roll:

EDIT: With help from CatDude and trio we have come up with a working slide show. I am releasing the basic widget version and CatDude is working on a GUI 'standalone' version which will probably end up as the 'official' 'Xlideshow'.

Notes
You should have 'xli' if you have Pwidgets, if not you can get conky-1.6.1.pet plus dependencies, it includes xli, and also needed is Scale2pics
Download and install 'xlideshow-0.0.1.pet'
It installs a directory called images.
Put .png or .jpg images in there, say up to 20 for a machine under 1gig processor, 25 to 50 for up to 2gig, 55 to 100 for a 2gig and over with a gig of ram. These are just guesses, I tested on my 1066Mhz CeleronM, with 512MBram with 25 images of various sizes. Keep the speed of your machine and size of images in mind. NO responsibility taken if your machine crashes, use at your own risk, sorry must say this stuff, you know
That's it. Start it from the menu or drag ~/my-applications/bin/xlideshow.sh to the desktop, or, type 'xlideshow.sh' in a terminal. In Jwm it is normal to see the commentary in the bar. Icewm won't do it. Not tested on other WMs but should work. Edit:Ok, icewm will do it but there is a fix; insert

Code: Select all

#xli picture viewer
WM_CLASS=xli
WM_NAME=xli
xli.layer: Desktop
xli.allWorkspaces: 1
xli.dBorder: 1
xli.dTitleBar: 0
xli.ignoreTaskBar: 1
xli.dMaximize: 0
xli.dMinimize: 0
xli.dRollup: 0
xli.dResize: 0
xli.dClose: 1 
at the end of ~/.icewm/winoptions

Not tested with Xvesa. Testers?

There is still work to do. Feedback is important.


.Changelog
27dec08: uploaded xlideshow-0.0.1
can now set position on screen, can change coordinates to suit your resolution, just open '~/my-applications/bin/xlideshow.sh' in a text editor and alter the values after '-geometry', thx trio
Empties '~/scaledimages' automatically, thx CatDude
28dec08: removed old versions, you can hack away at the latest one
Attachments
xlideshowjwm.jpg
(48.59 KiB) Downloaded 1206 times
xlideshow-0.0.1.pet
(1.17 KiB) Downloaded 836 times
Last edited by 01micko on Sun 28 Dec 2008, 05:42, edited 14 times in total.
Puppy Linux Blog - contact me for access

User avatar
J-Bob
Posts: 282
Joined: Sun 10 Feb 2008, 00:58
Location: Canada
Contact:

#2 Post by J-Bob »

I'm not much of a coder, but i might be able to rig it to build a bugfixing splash screen.

- J-Bob

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#3 Post by CatDude »

Hello 01micko

I thought i would give this a go, and report my findings.

I followed your instructions (to the letter)
but i had to make: /root/xlideshow.sh
executable for it to run.
01micko wrote: Put any size image you want in the ~/images folder.
Did that, all of the following images are 800x600
  • /root/images/Vista1.jpg
    /root/images/Vista2.jpg
    /root/images/Vista3.jpg
    /root/images/Vista4.jpg
    /root/images/Vista5.jpg
    /root/images/Vista6.jpg
Here are the contents of: /root/scaledimages
  • /root/scaledimages/01.jpg................(140x90)
    /root/scaledimages/Vista1.jpg.........(107x80)
    /root/scaledimages/Vista2.jpg.........(107x80)
    /root/scaledimages/Vista3.jpg.........(107x80)
    /root/scaledimages/Vista4.jpg.........(107x80)
    /root/scaledimages/Vista5.jpg.........(107x80)
    /root/scaledimages/Vista6.jpg.........(107x80)
At line 15 of: /root/xlideshow.sh
it has the following:

Code: Select all

scale2pics ~/images ~/scaledimages 120 80 100 jpg &
Am i correct in thinking that that translates as, 120 pixels wide x 80 pixels high with 100% quality ?
if so, then where does the 107 pixel width come from ?

The attached image shows the contents of: /root/images and /root/scaledimages
it has been edited to show both the first image (01.jpg) and the second image (Vista1.jpg)
for comparison.
01micko wrote: The slide show will show up somewhere, probably topleft, of your screen and should endlessly loop.
The center of the xlideshow window appears at roughly 360x380 on my desktop (running at 1280x960),
and it does indeed loop endlessly.

If you want me to try anything, just ask.

CatDude
.
Attachments
xlideshow.png
just for comparison
(121.49 KiB) Downloaded 1545 times
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#4 Post by 01micko »

Catdude
Yep, was late at night when I posted that and I was trying different resolutions. Should keep it at 120x80 for now. (I'll edit post)

Please hack away! I'd appreciate it. Add, takeaway, rewrite, whatever tweaks you can come up with.

Funny about the permissions on ~/xlideshow.sh. Any way I'll add that too. Even wierder the 107x80. Might have something to do with that 140x90 error. Anyhow resize that to 120x80 and have another go. You are correct with the "120 80 100" line

Cheers

PS, I checked the file I uploaded and it was executable on my system. Strange. Anyways, reuploaded a fresh one, no changes.



PPS: Catdude! I did the sums and 107x80 is the correct aspect ratio for any standard, (ie not widesceen) screensize. The 120x80 allows for a little wider image. If you try some other sizes, even portraits you will find that the height remains constant, this will be good for Pwidgets. The exception will be anything with a wider aspect ratio than 120x80 so I probably should alter the x value to something like 140, that way widescreen images should render correctly. Also banners will be limited to that width, but who wants banners in a slideshow?

Update: I have had xlideshow running for 4 hours straight now with no issues so I think we have a solid foundation to build on.

Update 3 hours later: still running and started it by clicking once on the excecutable.

Another Update: CatDude has tested and provided useful feedback, there are 7 others out there in the puppy-internet-wilderness that have downloaded this script. Feedback? Does it work for you? Are your machines crashed and burnt?

Have fun! :wink:
Puppy Linux Blog - contact me for access

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#5 Post by 01micko »

I have made it easier. Made the .pet for xlideshow.

Notes-
Must be run from command line with the code

Code: Select all

xlideshow.sh
or click on ~/my-applications/bin/xlideshow.sh
It will crash X if you try to make a short cut. (maybe?)(must investigate)

Dependencies are not in the .pet so you will still need 'xli' and Scale2pics.

Have changed the image maximum size to 140x80 to better support widescreen images.

There is already an image in '~/scaledimages' named '01.jpeg'. You can change it to whatever you want but it must be named '01.jpeg' and should be <140 wide x 80 high. On a slow machine try it with up to 10 images. A fast machine should handle 30 or 40. Jpeg or png images can be used but png images will be slower, as will very large images, bear that in mind, consider your machine's speed. Place images in '~/images' (which the .pet created).

Don't worry, it will take 15.5 seconds to load even on the latest machine, be patient.

Enjoy!

Edit: Ok, it will crash X if you start it from a shortcut, but you can call it from a simple script (it is designed to be called from a script any ways)
.

Code: Select all

#!/bin/bash
xlideshow.sh
Name it something like 'startslide.sh'.
Make it executable and your away. In a terminal type

Code: Select all

chmod 755 startslide.sh
newer version: see main post
Attachments
xlideshow-crop.jpg
(28.16 KiB) Downloaded 1423 times
xlideshow-shot0.jpg
(77.33 KiB) Downloaded 1550 times
Last edited by 01micko on Sat 27 Dec 2008, 03:55, edited 1 time in total.
Puppy Linux Blog - contact me for access

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#6 Post by CatDude »

Hello 01micko
01micko wrote:Zigbert said that with clever use of xli that we might be able to come up with a slideshow widget for Pwidgets. Well, I had a go, and I have limited (ie; nil) coding skill. :mrgreen:
And i have even less
01micko wrote: Please hack away! I'd appreciate it. Add, takeaway, rewrite, whatever tweaks you can come up with.
So i did.

Here's the score.
With the attached script (a hybrid, bits of Pwidgets & bits of Pwget)
it is possible to:
  • Choose from a combobox, what size xlideshow displays at.
    Choose from a combobox, the quality of the images displayed.
    Choose from a combobox, the delay between each image being displayed.
    Select any directory containing images for the xlideshow.
Dependencies are the same as you stipulated in your original post.

To get my script to run you need to do the following:
  • 1) Download and install Scale2pics.pet and xli should be on your system
    2) Get the script catdudes-xlideshow.sh.tar.gz, and .xlirc.gz unzip them in the root directory.
    3) Create a ~/scaledimages directory
You do not need to put an image named '01.jpg' into the ~/scaledimages directory,
when you run the script it will create a blank file called '01.jpg', which seems to work OK. :roll:
Each time the script is run, it will delete ALL files in the ~/scaledimages directory,
and re-create the '01.jpg' file.

I have run it from a desktop shortcut, the iceWM menu and by just clicking on it, without any crashes or anything.

The code is probably not as correct as it should be (like i said above, i have no experience really)
and i am sure that it could be cleaned up some, by someone who knows what they are doing.

I attach a couple of images to show what it looks like.

CatDude
.

P.S
My apologies to Lobster & Zigbert for butchering their code,
but we have to start somewhere now don't we.
Attachments
catdudes-xlideshow.png
(17.54 KiB) Downloaded 1430 times
catdudes-xlideshow.sh.tar.gz
(941 Bytes) Downloaded 751 times
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#7 Post by 01micko »

Thanks CatDude!
Runs perfect!

Todo list:
must set the position of the show. There is an option called '-at' in xli. Also have to make it run quiet. There is a quiet option too. I'll see what I can do, you too, see what happens.

Code: Select all

xli -help
brings up the interactive help menu in xli. I haven't had much luck yet but I'm sure it isn't too hard.

Love it! :wink:
Puppy Linux Blog - contact me for access

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#8 Post by CatDude »

Hello Micko
01micko wrote:Thanks CatDude!
Runs perfect!
That's good to hear. :lol:
01micko wrote: Also have to make it run quiet.
What do you mean by quiet ?

CatDude
.
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#9 Post by 01micko »

CatDude wrote:]
What do you mean by quiet ?

CatDude
.
Get rid of the commentary, I see by your screenshot you have it. I'm gonna have a look at some more of zigbert's work. I've been a bit tied up at the moment.

Thanks
Puppy Linux Blog - contact me for access

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#10 Post by CatDude »

Hi
01micko wrote: Get rid of the commentary, I see by your screenshot you have it.
Are you refering to the stuff in the titlebar ?

I noticed in your images above:

xlideshow-crop.jpg
xlideshow-shot0.jpg

it appears that you have no window borders or titlebar, how did you manage that.

CatDude
.
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#11 Post by 01micko »

I just reproduced what you have in Icewm. I was using JWM. Seems Icewm starts xli in a window, interesting.
Puppy Linux Blog - contact me for access

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

No border and window position how to

#12 Post by trio »

CatDude wrote:Hi
01micko wrote: Get rid of the commentary, I see by your screenshot you have it.
Are you refering to the stuff in the titlebar ?

I noticed in your images above:

xlideshow-crop.jpg
xlideshow-shot0.jpg

it appears that you have no window borders or titlebar, how did you manage that.

CatDude
.
Hi, I just want to share, you cannot set a spot for where the xli window should appear with xli command or to make it without border, but it is actually the a window that is controlled by your window manager, in my case icewm. you have to add below lines to the /root/.icewm/winoption or if jwm you can edit /root/.jwmrc (but that is all different command lines):
#xli picture viewer
WM_CLASS=xli
WM_NAME=xli
xli.layer: Desktop
xli.allWorkspaces: 1
xli.dBorder: 1
xli.dTitleBar: 0
xli.ignoreTaskBar: 1
xli.dMaximize: 0
xli.dMinimize: 0
xli.dRollup: 0
xli.dResize: 0
xli.dClose: 1
xli.geometry: +890+560
Attachments
mydesktop.jpg
see i use border for the xlideshow, you can totally remove by putting 0 value to respective line as i explained
(53.28 KiB) Downloaded 1352 times

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

Additional info

#13 Post by trio »

use this script:

sleep 0.5
xli -fit -geometry 100x80 -delay 5 -goto ~/scaledimages/01.jpg ~/scaledimages/*.jpg

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

#14 Post by trio »

Another one of my puppy desktop

Note: if you don't put -geometry ...x.... in the script, then you'll get a window that always resizing to the size of the picture...
Attachments
desktop.jpg
(35.69 KiB) Downloaded 1346 times
Last edited by trio on Fri 26 Dec 2008, 14:22, edited 1 time in total.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#15 Post by 01micko »

Thankyou trio!
And I'm sure onbehalf of CatDude!
Works a treat. Just had to adjust x y values for my screen res.
I figured some type of config file would be the go, and may still be. We have to try and please Jwm and Icewm.

Ok trio, just read you posted again about geometry, will try that and get back.

Cheers
Attachments
xlideshow-icewm.jpg
(22.74 KiB) Downloaded 1461 times
Puppy Linux Blog - contact me for access

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

For .jwmrc

#16 Post by trio »

should be put before the ending </jwm>

<Group>
<Class>xli</Class>
<Name>xli</Name>
<Option>noborder</Option>
<Option>notitle</Option>
<Option>layer:1</Option>
<Option>sticky</Option>
</Group>

But I don't know what's the equivalent of xli.geometry ...+... (icewm) for jwm, to make the window position persistance

Glad I can contribute 01Micko............

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#17 Post by CatDude »

Hi

@ trio
Nice one mate, i much prefer the look of it without a border etc. 8)

CatDude
.
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#18 Post by 01micko »

CatDude, trio
I have fixed the code so xlideshow runs where ever you want on your screen and it was sooooooo simple. Works in your script too Catdude.

Code: Select all

xli -geometry +870+600 -delay "$DELAY" -goto ~/scaledimages/01.jpg ~/scaledimages/*.jpg
where '+870+600' is the position on screen of the topleft of the image.

Maybe you could hack your script to have a 'position' option in your gui.
Here's a shot. I'm using Jwm but it should work in Icewm or any window manager, but to truly test it in Icewm you would have to remove those lines provided by trio.

We can have two versions of this, the widget version (which zigbert would I'm sure incorporate into Pwidgets, it is small enough) and the gui 'standalone' version. Only one problem left. In Jwm it still runs the commentary in the bar. Hmmmmm, but anyhows,

WE now have a working slide show made for Puppy, built by Puppians!
I'll steal some of your code if you don't mind CatDude, the bit where the folder ~/scaledimages gets emptied and creates '01.jpg. They say mimicry is the greatest form of flattery :wink: . I'll pet that version up as 'xlideshow-0.0.1'
I knew you were on the right track with 'geometry', trio.

Thanks guys.

Micko
Attachments
xlideshowjwm.jpg
(48.59 KiB) Downloaded 891 times
Puppy Linux Blog - contact me for access

User avatar
trio
Posts: 2076
Joined: Sun 21 Dec 2008, 15:50
Location: अनà¥￾मोदना

geometry

#19 Post by trio »

I think you hit the jackpot there micko, why didn't I thin of it....cheers

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

Re: geometry

#20 Post by 01micko »

trio wrote:I think you hit the jackpot there micko, why didn't I thin of it....cheers
Thanks trio,
I uploaded 'xlideshow-0.0.1.pet for testing. See main post.
Puppy Linux Blog - contact me for access

Post Reply