LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   one random wallpaper on startup? (https://www.linuxquestions.org/questions/linux-general-1/one-random-wallpaper-on-startup-521507/)

newbiesforever 01-21-2007 05:31 PM

one random wallpaper on startup?
 
In my distro, MEPIS, I see that KDE can make the desktop background a slideshow. That's nice, but is there any way it can give me one random background at startup, to remain in place until the next startup? If KDE can't do that by itself, is there any software out there that can?

Brian1 01-21-2007 06:31 PM

Been thinking about that trying a few things. So far most ideas fail. Now one idea I have and have not fully tried do to the fact I am terrible at things like sed and awk. The file that contains the background choice in is your home directory. ~/.kde/share/config/kdesktoprc. Now here is my idea.
If all the backgrounds were in a directory then with a script like this.
I would pull a list of the files with the ls command or maybe others and send the output to a txt file.
Then it will randomly select one of the files from that list. Of course I am sure it can select directly from the command and send to the correct location in one command sequence.
Now using awk and sed it knowing the correct line your wallpaper is, it would replace the one in ~/.kde/share/config/kdesktoprc file.

Now I think this needs to be run before KDE starts for the user. It can be run from the /etc/rc.local script.

It could be simliar to the scripts from the random theme script from here. http://www.kde-look.org/content/show.php?content=37061

Brian

Sonneteer 01-21-2007 08:32 PM

I think it would be easier if you used the DCOP calls that are available.
When the background is on slideshow, the command
Code:

dcop kdesktop KBackgroundIface changeWallpaper
will change it. So if you put your pictures in the slideshow set up, set that to random, and then set it to a large amount of time between changes, and have that dcop command in an executable file in ~/.kde/Autostart/. That's how I would do it anyway.

Brian1 01-22-2007 04:17 PM

I new there had to be a simply way. Never used dcop much so not familiar with it full potention. Will make a not of this. Let us now how well it works for you.

Brian

javaunixsolaris 05-30-2007 01:11 PM

Quote:

Originally Posted by Sonneteer
I think it would be easier if you used the DCOP calls that are available.
When the background is on slideshow, the command
Code:

dcop kdesktop KBackgroundIface changeWallpaper
will change it. So if you put your pictures in the slideshow set up, set that to random, and then set it to a large amount of time between changes, and have that dcop command in an executable file in ~/.kde/Autostart/. That's how I would do it anyway.

Thanks Sonneteer that's a suitable solution for my problem but I'm wondering how do I change the background when it's not on slideshow? I'm planning on writing a script that downloads a picture everyday and then sets my background to that picture; I don't really need slide show functionality, and I can't find the command to do it. (plus dcop doesn't have a man page).

Nevermind: http://www.linuxquestions.org/questi...50#post2768350


All times are GMT -5. The time now is 04:07 PM.