Jump to content

changing wallpaper automatically


Urza9814
 Share

Recommended Posts

Is there any program I can use to change my wallpaper based on the time of day? I want to have one thing in the morning, then like, when it gets dark...around then...change it to another, then change back while I'm asleep. Is there any program that will do that?

And if for some reason there isn't (though it seems like it'd be really easy...) does anyone know if the C++ 'system()' command works the same way in Linux as in Windoze?

Edited by Urza9814
Link to comment
Share on other sites

aight then...I'll hop over to the cpp-home forums for my inquiry about what changes in Linux and let you know when (or if) I finish this. Shouldn't take too long, but a friend's here right now, so I'll have to do it in an hour or 2...

...I was kinda hoping you wouldn't know of a prog to do it actually...I haven't written any code in a few months... :D

Edited by Urza9814
Link to comment
Share on other sites

I think I've got this thing nearly done (Had a lotta problems in the beginng)...but I got one problem...

How do you set the background from a console window?

Link to comment
Share on other sites

Hmm,

 

First open up console and type in

 

fbsetbg -c /path/to/wallpaper.jpg

 

You dont' have to have the ' -c ' but if you read on Iphitus FAQ he explain why you need it.

 

-Luis

Link to comment
Share on other sites

-there's chbg

http://gnomesupport.org/forums/viewtopic.p...&highlight=chbg

 

-see what this is? :unsure:

http://gnomesupport.org/forums/viewtopic.p...light=wallpaper

 

-you could write a script and use the sleep command

 

-you could modify aru's script

http://gnomesupport.org/forums/viewtopic.p...&highlight=chbg

function wallpaperRandom () {

    # Random wallpaper.

                                                                       

    # on mandrake I use xli on debian, in mdk I use wmsetbg

    # wallpaper_cmd="${Xdir}/wmsetbg -s "

    wallpaper_cmd="${Xdir}/xli -onroot" # -fork"

    images_dir="${HOME}/xresources/backgrounds/"

    images_filter="*.jpg"

    error='Problems running ${wallpaper_cmd}'

                                                                       

    images_list=($(/bin/ls ${images_dir}/${images_filter}))

    image=${images_list[$((${RANDOM}%${#images_list[@]}))]}

                                                                       

    ${wallpaper_cmd} ${image} || echo ${error} >&2

}

                                                                       

# run the wallpaper function:

wallpaperRandom &

Link to comment
Share on other sites

well, I got it running...I'll know in a half hour if it works, an hour and a half for full testing...

One question though...is there any way to make it hidden, or would I have to do that in the code itself?

Link to comment
Share on other sites

If you mean run it as a background then you can just make it a service..

Just make a startup script in /etc/init.d (usually just rip off an existing one and modify it)

then you symlink it from the runlevels you want it to run at (5)

(if I get this the right way round its)

ln -s /etc/init.d/wallchange /etc/rc5.d/S99_wallchange

 

(assuming wallchange is the name of the script )

 

This is a real neat idea... specially for a PC in a bedroom but screensavers by time and/or season/... cool.... imagine in Winter the fire saver comes on ... or in asummer a animation of a big fan :D

Link to comment
Share on other sites

man...the prog failed...and I don't know why, as my CPU usage was at 100% while it was running, meaning it's doing SOMETHING (I didn't know how to do any kind of pause or wait command, so it was checking if it was the right time as fast as possible :P)...maybe I could figure it out just by looking at the code...maybe not...I don't know, and I'm too lazy to try...besides, I'll be getting a book on graphics soon :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...