Siduction Forum

Siduction Forum => Software - Support => Topic started by: ayla on 2015/07/15, 11:35:32

Title: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: ayla on 2015/07/15, 11:35:32
Hi,

first: The "slideshow" on the KDE-desktop is workin. If I use a folder full of jpg images and add it to the slideshow I can view this Images in random order, as is to be expected.

What is not working as before (KDE4) is this case:

I have a script running, "Portal View Live Desktop Wallpaper", which stores me, on a two minute cycle, images from different webcams around the world in the same folder under the same name. Which means this picture "current" changes every two minutes to the current picture of the webcam in turn and the cycle of my slideshow is two minutes also.
So on KDE4 desktop I had fresh pictures from different places of the world comming up periodicaly as background, which, I guess, means that the image to show was loaded every cycle from "current" anew if "current" was the only image in the slideshow folder.

This seems to have changed. The slideshow now stays on the first picture stored in "current.jpg" when startet. The picture displayed on desktop does not change any more, no matter what image "current" has changed to and new images, which weren't in the folder when the slideshow starts, aren't recognized, too. So no possibility to store with consecutive number and delete the one before and get it to run again this way.

So, pity, this renders the slideshow for this case useless.

I guess this is a seldom usecase, so I dont expect a fix.

But if someone would point me to the script or part of code which is resposible, maybe I could try myself.

Greets
ayla
Title: Re: slideshow in KDE 5 desktop
Post by: hendrikL on 2015/07/15, 12:59:27
I know it is a bit off topic, but take a look here (have to share what i found  8)  )  , maybe you will also find, by searching , a solution for your little Problem in that forum.
https://www.kubuntuforums.net/showthread.php?67703-Kubuntu-video-wallpaper (https://www.kubuntuforums.net/showthread.php?67703-Kubuntu-video-wallpaper)
Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/15, 17:23:06
... images from different webcams around the world in the same folder under the same name. Which means this picture "current" changes every two minutes to the current picture of the webcam in turn and the cycle of my slideshow is two minutes also...


Do you mean that it changed cameras automatically?  Or do you mean that it changed the image from the chosen camera every two minutes?

l had this script working on my prior KDE 4 desktop and now I will try to set it up again on Plasma 5.  But I never saw a way to switch cameras automatically -- that was always a manual task.


EDIT:  The "current.jpg" image is provided by the line in getpic.py that contains the URL of the image:


Code: [Select]
...    try:
        file = urllib.urlopen('http://images.webcamgalore.com/webcamimages/webcam-012769.jpg')
        im = cStringIO.StringIO(file.read())
...


So, if you wanted the image to come from different cameras, you would have to script the rotation cycle of cameras here.  I suppose you could simply repeat the code section starting below the timer value ... I'll give it a try.
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/15, 17:43:27
Hi dibl,

I changed the "portal view" python script -with help from this forum- lightly. I brought in a loop, some error sequences, and simply multipled the part were the picture gets captured and used another camara in every multipled part.

Here is the script as it is now. The commentet out part was a cam in my home net with secured acces, which I got out of the net somewhere -no idea where any more.

  http://paste.siduction.org/20150715153745 (http://paste.siduction.org/20150715153745)
 
I also let it run two times with to different named folders to display different backgrounds on my two screens and startet this with this script in KDE 4 autostart. This autostart is not working too since KDE 5 and I have to have a look at the why, too.

Code: [Select]
#!/bin/bash

python /home/cal/Downloads/live_wallpaper/getpic.py & python /home/cal/Downloads/live_wallpaper/getbild.py

greets ayla

EDIT: 
Quote
"I suppose you could simply repeat the code section starting below the timer value"
yep, thats in short what I did.


@hendrikl: That, of course, is interesting too. But then I would need cameras which give me an actual live stream -in very high quality. That I would avoid because for my impression it would be too much traffic generatet for a minor eyecandy. The other way would be to get my jpg's every two minutes, convert them to a two minute avi file or mpeg4 and then display this files. -Would be an interesting workaround :)
But I'm not now gone thrue all the links provided in the side you linked, I will continue there later. Thanks
Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/15, 20:26:57
... and startet this with this script in KDE 4 autostart. This autostart is not working too since KDE 5 ...


I am running live-wallpaper automatically by starting with this "live-wallpaper.desktop" script in ~/.config/autostart:


Code: [Select]
[Desktop Entry]
Comment[en_US]=
Comment=
Exec=/home/don/portalview-start.sh
GenericName[en_US]=
GenericName=
MimeType=
Name[en_US]=live-wallpaper
Name=live-wallpaper
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=don


However, I see the problem that you described.


Checking with gwenview, the "current.jpg" image file is actually changing every 120 seconds, including the camera rotation cycle, but the Plasma 5 desktop remains the same image as when it was first shown after login.


So the problem seems to be that Plasma 5 paints the desktop wallpaper once, for the entire login session.  :(
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/15, 20:33:57
I'll try the .desktop file, thanks.

Code: [Select]
So the problem seems to be that Plasma 5 paints the desktop wallpaper once, for the entire login session.
It works if there are multiple images in the folder. But it seems to load this folder just once per session because new or changed files are not displayed when inserted after the start of the slideshow.
Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/15, 20:40:25
In KDE 4 I never used the KDE "slideshow".  The live-wallpaper script changed the wallpaper every 120 (or whatever) seconds, alone.  I ran that on one side of a 4-sided cube, with other images on the other faces.  We're still waiting for Plasma 5 to offer "different activities" on the virtual desktops.
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/15, 20:47:54
In KDE 4 I never used the KDE "slideshow".  The live-wallpaper script changed the wallpaper every 120 (or whatever) seconds, alone.

Interresting, that never worked for me, so I thought it's just for providing the images... Will have a look at the original script again.
Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/15, 21:32:17
so I thought it's just for providing the images...


Yes, it only pulls in the images and converts them to your "current.jpg" file.  Then your KDE4 plasma desktop wallpaper selection displays it. But the KDE4 desktop wallpaper display apparently updated every time the "current.jpg" file got updated.  I wonder whether there is a .xxxrc file somewhere under ~/.kde that has a refresh value in (or could have a refresh value added to it)?

Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/15, 22:09:38
The wallpaper is set with ~/.config/plasmarc.  If a shell script could process that every 120 seconds, I think you could change the wallpaper.  But I don't know how that file is processed, or whether you could preserve all other open desktop activities/windows while changing only the wallpaper.
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/15, 22:15:07
Ok, thanks dibl, I 'll try a bit. Was searching the file on the left of this one when receiving the email for your post :)
Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/15, 22:23:55
I think
Code: [Select]
dbus-launch plasmashell && exit might be part of the solution.  Here I can change the wallpaper after live-wallpaper has pulled in the next image.  So that command needs to be in a scripted loop with a 2-minute timer.
Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/15, 22:49:15
Try this:


Code: [Select]
#!/bin/bash
while true; do
   dbus-launch plasmashell &
   sleep 120
done
#trailing line


Seems to work here.  I'll make a .desktop file in ~/.config/autostart to call it at login.


EDIT:  It "works", but it is very tough on CPU resources.  Hopefully a better way can be discovered by folks smarter than me.  :)
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/15, 23:06:06
Try this:


Code: [Select]
#!/bin/bash
while true; do
   dbus-launch plasmashell &
   sleep 120
done
#trailing line


Seems to work here.  I'll make a .desktop file in ~/.config/autostart to call it at login.


EDIT:  It "works", but it is very tough on CPU resources.  Hopefully a better way can be discovered by folks smarter than me.  :)

CPU usage raise just a little every two minutes here, thats bearable I would say :)

Works fine here too, thanks a lot.

greets
ayla
Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/15, 23:16:39
It's beating hard on my CPU here, and it's a core i7.  I must be doing something wrong in calling it from the .desktop file.
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/15, 23:21:23
Not tried the autostart so far.

But I see it's eaten up RAM. It seems to dont free it after reserving/using it.

EDIT: Have to watch this tomorow after setting up all clean, it could be possible something else is responsible for the increasing usage of RAM here.
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/16, 11:33:21
After setting up the desktop files and autostart it works so far, but...

My CPU usage is not the problem, it's going up to use all cores for about two seconds at about 15% (see system below).

But, nothing running then the services startet by systemd, kmix and  kmail, the usage of RAM increases on every run of plasmashell at about 150MB.

Starting the script from console gives a lot of messages indicating heavy activity:

  http://paste.siduction.org/20150716091217 (http://paste.siduction.org/20150716091217)

So I think I'm back to my first Question. Where can I find the -hopefully well documented or I'm lost in deep space- script/code which is running the slideshow? The slideshow works so far, and I guess I ..."simply :) "... have to tell it, insteed of using an at startup somewhere stored image -what's, my wild guess, it does-, to read the file to display anew every time and all works as it should.
I' ll search the ...rc files you've pointing me to, when I get the time, again and hope to get a hint there...


 
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/17, 18:12:50
Hi,

I don't know why, but now my slideshow uses new files, even if they are insertet into the folder after slideshow had startet, as long  there is not only a single image file in the folder which uses the same name as the one before.

Im pretty sure I've tried this several times before to solve the mentioned issue and it didn't...

I have done nothing!!  ::)

So I changed my script and store now for every camera with an index, eg current1.jpg, current2.jpg, current3.jpg.
I have at the moment three different images in the folder where every image changes every two minutes and the cycle of the slideshow is two minutes, too. -OK, 2 min and 1 sec, because in slideshow it's not possible to set the seconds to zero.

This works so far, but the order the images show up are random, which means some Images are played double, some get lost.

I will try now what happens if I delete the other images, the moment a new one comes in, and don't keep the name.

greets
ayla
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/17, 19:56:45
hrmpf  :-\

If I have 3 images in the folder where my slideshow is pointet to when it starts, with this script it works (after first cycle is finished):

  http://paste.siduction.org/20150717173927 (http://paste.siduction.org/20150717173927)
 
If I have just two images in the folder at the start it just changes between the to imagenames which were present at startup...

So it seems I have to store three images when I leave the session to get it startet with three cams next time...  :(

diggin...

EDIT: or I have to store 3 similar named images in the folder before plasma starts, or restart plasma once.
Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/17, 21:44:03
Thanks for all the work! I'm going to give it another shot on the weekend.


Semi OT -- I was googling for more plasma 5 development issues and I was disappointed to find that the ability to put different wallpapers on different virtual desktops is not in the plan for plasma 5. For KDE 4 I found that a useful way to organize multiple activities.  Too bad.   :-[
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/17, 23:00:17
Hi,

never worked with the activities or virtual desktops, will have a look at the possibilities it serves when I have more time :)

This slideshow is making me complete crazy. Now it works as it should when I give it the 3 images even after it startet and let the script delete/replace them in the cycle untill there is just one changing (content and name) left. Again I did nothing other then before.  I encounterd it when preparing the folder for a next session. What the... , did they erroneously build an AI and it learns? ;D

Think I'm givin up for today and give it another try tomorrow. Thinking about a testseries to learn what rules this ....thing follows, -if any.
Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/17, 23:22:10
@ayla your method is working!  I have set 4 cameras, each gets a new image every 2 minutes.  So that means the script takes 8 minutes to completely refresh all four images.  Using the slideshow background, the images appear to be shown in random sequence, so it sometimes happens that the same image appears twice because the script has not run the full 8 minute cycle.  But eventually there are new images for each one.  And very low CPU and memory usage, by the way.  Nice! Thanks for your work on it.
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/17, 23:35:30
With how much images in the folder did you start the slideshow? Do you use the script which is leaving just one image after the first cycle is completed?
Title: Re: slideshow in KDE 5 desktop
Post by: dibl on 2015/07/18, 00:59:50
I am writing 4 images in the target directory.  Each image is updated every 120 seconds. I set the slideshow also to change every 120 seconds.
Title: Re: slideshow in KDE 5 desktop
Post by: ayla on 2015/07/18, 11:23:38
Hi,

seems it runs now. I have to start with three images to get the slideshow cycle thru all images of the three cams. I do this by copying three images to the folder the slideshow uses on start of the script, named as the images the script provides later and let all but the current one delete during the cycle to prevent it from randomized displaying.

My script in use:
  http://paste.siduction.org/20150718085816
 
For my main screen I have a second script running, which stores it's images in a second folder. This gets a picture of the earth with the day and night zone changing over the day.
http://www.opentopia.com/images/cams/world_sunlight_map_rectangular.jpg
As the slideshow refuses to load new images when only one periodicly changing image is in it's folder in use, I simply added a second cycle and did the naming and the initial and deleting sequence as shown in the script above. Now this one also runs as it should.

greets and thanks for help and not let muddling me alone  :)
ayla
Title: Re: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: dibl on 2015/07/18, 15:59:52
I posted my ~/.config/autostart/live-wallpaper.desktop file above. There's a 3-line shell script to start the getpic.py script in my home folder. I did very little editing to the getpic.py script, just enough to repeat the capture for four cameras.  Here it is:
 
http://paste.siduction.org/20150718140327 (http://paste.siduction.org/20150718140327)


The script overwrites the four image files, so no need to delete anything. Just  point the KDE slideshow to the folder with the images, set the timing for 2 minutes, and then log out and log back in and it starts.  Note that it takes a full 8 minutes for the script to finish a new cycle of image captures.
Title: Re: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: ayla on 2015/07/18, 16:42:28
Quote
The script overwrites the four image files, so no need to delete anything.


Hi,

so of course, doing it that way, there is no need for initializing, because there are allways 4 images present and if  random order of displaying is acceptable there is no need for deleting too.

I wonder whether it would be possible to get an sequential order of displaying other then the way I did. And a pity that it is not possible to insert complete new images into the slideshow after it is startet.

A sequential order with defined starting point would also be a good thing for e.g. displaying a pictorial history or a comic strip. But ok, one may create a video for that and display it the way HendrikL has pointet to, with use of more ressources of course..

greets
ayla
Title: Re: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: GoldNugget on 2015/08/12, 01:23:05
Hello.
 I am the author of this program. It sounds like you got it working using a script and I'm glad it's working for you now. If you haven't tried it already, I would like to suggest a simpler solution:
You can launch several instances of PortalView a few minutes apart. For example, you could start five different instances of PortalView, pointing to five different locations. Set each one to update every ten minutes and launch them two minutes apart. The result should be what you were looking for...live images from a variety of webcams around the world rotating every two minutes. No extra script necessary. Remember all the images need to be the same format, that is all jpgs or gifs for example.

Good luck and feel free to email me if you have any questions.

Michelle

michelle@goldnuggetwebs.com
Title: Re: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: ayla on 2015/08/12, 08:07:19
Hi GoldNugget,

welcome to siduction forum and many thanks for your work on PortalView.
I use it for over an year with two instances and two folders for two displays and PortalView itself was and is working just fine.
 
I just added some "try" and "pass"  to prevent the script from stopping in case of errors caused by network failures or broken images, after the first few weeks of using it. With help from this forum of course because I know nearly nothing about python script language or other programming languages.

What has changed now was the behavior of KDE's slideshow when switching from KDE4 to KDE5.
Before I installed KDE 5 I had simply 3 cams which changed every two minutes and stored an image which was named "current" in one and the same folder. So the image got overwritten every two minutes from a new one. Parallel slideshow used a two minute cycle and displayed this new picture.
Now, with KDE 5, slideshow does not change the displayed picture any more if there is only one image in the folder and the image changes but it didn't change it's name. It shows the first one continiously.
If there are more than one images in the folder it shows them in a random order, which I don't like. So I let the script name the images with an index and  on every new image delete the one before.
That worked one time when I startet slideshow, but another time I had the same image played continiusly...
After a lot of tries I had it stable working as I like it when slideshow found  3 images when it starts, named the same as the images I liked to display during the cycles, which then get deletet on the first cycle. Easiest way to do so was adding this to the PortalView script.

I will test your suggestion using different folders for the different cams, as one can give slideshow more than one folder to get its pictures from, but my suspicion is that I get them displayed in random order again. Will report back, but may take a few days.

Thanks again
ayla
Title: Re: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: dibl on 2015/08/12, 12:00:34
Hello.
 I am the author of this program.



Thanks for your work Michelle!  I presently have 9 cameras/images that randomly display every 2 minutes, and this a very satisfactory wallpaper solution.
Title: Re: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: dibl on 2016/06/03, 20:12:08
Nice addition with the new plasma-desktop -- two monitors can show individual (different) slideshows now.   8)
Title: Re: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: urcindalo on 2016/11/18, 14:59:17
Dear @ayla

I have just posted in Gentoo forums the following:
===
I use xplanetFX to render a new Earth image every ten minutes, which I'd like then to set as my desktop wallpaper.

Back in the good old KDE 4 times, it was as easy as selecting "Slideshow" as my desktop wallpaper setting, pointing it to the folder where I render the xplanetFX's image into, and set its timer every ten minutes.

Unfortunately, the same thing does not seem to work automatically on Plasma 5 (stable amd64 packages). By automatically I mean that, if I open Desktop Settings ("Slideshow" mode) and change from "centered" to "scaled", for instance, and then I hit Apply, then the definded folder is read and the wallpaper is updated (the folder contains just one image file, two at most if I set a symlink to it). But, if I do nothing, the timer setting does not seem to be honored and the image is never updated at the defined intervals, even though xplanetFX is correctly updating the rendered image every ten minutes.
====

In this thread, you say you found a workaround with the help of some script you wrote. Unfortunately, the script link is not valid anymore.

Would you be so kind as to re-post it, as well as guiding me on how to get Slideshow to work with its help?

Thanks very much in advance.
Title: Re: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: ayla on 2016/11/19, 01:07:56
Hi,

I'm sorry, I don't think that the changes I added to GoldNuggets fine program http://goldnuggetwebs.com/portalview/ will help you in your case.

As you can read in this thread the KDE slideshow changed it's behavior a year ago and I was trying to get the old behavior back by manipulating the content of the folder slideshow uses. I therefore decided to change the script which stores the live images there as the easiest way to get this done.

Also I cannot test slideshow right now because my plasma desktop is crashing when I try to change the settings of my wallpaper :(

I really hope kde is out of this mess of the last month soon...

As I think the changes in the script are of no use atm I will not repost it, but for what it may be worth I send you the script with commented changes with a pm.

greets
ayla

Title: Re: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: dibl on 2016/11/19, 16:26:13
Quote from: urcindalo@18NOV2016:9:59
...if I open Desktop Settings ("Slideshow" mode) and change from "centered" to "scaled", for instance, and then I hit Apply, then the definded folder is read and the wallpaper is updated...


True, it appears to me that merely changing the setting does not immediately change the execution of the slideshow.  You have to restart the plasma desktop, then the changes will be in effect.  However, setting up the shape and centering and timing and so forth would normally only be done once for the initial setup of the slideshow -- after that it should run continuously as you expect.  At least, that's the way it works for me.
Title: Re: (workaround found) slideshow in KDE 5 desktop and live_wallpaper
Post by: urcindalo on 2016/11/23, 17:33:07
Thanks ayla for your help and for sending me the script. Aslo, thanks dibl for your comments.


Based on ayla's ideas, I've solved my issue with a very easy workaround: I run the following script right after xplanetFX updates its output.
Code: [Select]
#!/bin/bash
cp /home/user/Config/xplanet/fondo-pantalla.png /home/user/Config/xplanet/fondo-pantalla2.png
cp /home/user/Config/xplanet/fondo-pantalla.png /home/user/Config/xplanet/fondo-pantalla3.png
cp /home/user/Config/xplanet/fondo-pantalla.png /home/user/Config/xplanet/fondo-pantalla4.png


As you can see, I keep four copies of the same file, all of them updated at the same time. This way, even though Slideshow chooses randomly, I always get what I want.