<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Am!NeS0Ft's blog &#187; Automatically changing wallpaper relatively to daytime in Ubuntu</title>
	<atom:link href="http://aminesoft.wordpress.com/tag/automatically-changing-wallpaper-relatively-to-daytime-in-ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://aminesoft.wordpress.com</link>
	<description>linux / unix / 3d / mac OS</description>
	<lastBuildDate>Mon, 21 Dec 2009 12:02:50 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='aminesoft.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/38a17e10ee7c245db760461859c24010?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Am!NeS0Ft's blog &#187; Automatically changing wallpaper relatively to daytime in Ubuntu</title>
		<link>http://aminesoft.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://aminesoft.wordpress.com/osd.xml" title="Am!NeS0Ft&#8217;s blog" />
		<item>
		<title>Automatically changing wallpaper relatively to daytime in Ubuntu</title>
		<link>http://aminesoft.wordpress.com/2009/03/05/automatically-changing-wallpaper-relatively-to-daytime-in-ubuntu/</link>
		<comments>http://aminesoft.wordpress.com/2009/03/05/automatically-changing-wallpaper-relatively-to-daytime-in-ubuntu/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 18:39:22 +0000</pubDate>
		<dc:creator>abdessmed mohamed amine</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Automatically changing wallpaper relatively to daytime in Ubuntu]]></category>

		<guid isPermaLink="false">http://aminesoft.wordpress.com/?p=208</guid>
		<description><![CDATA[Fedora 8 introduced a nice feature which is automatically changing wallpaper relatively to daytime. Here’s how to have this cool feature in Ubuntu (and any other linux distribution) !
Select four wallpapers, one to be displayed at sunrise, the second during the day, third at sunset and the last at night.
Then, in a terminal, create a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aminesoft.wordpress.com&blog=3705654&post=208&subd=aminesoft&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Fedora 8 introduced a nice feature which is automatically changing wallpaper relatively to daytime. Here’s how to have this cool feature in Ubuntu (and any other linux distribution) !<br />
Select four wallpapers, one to be displayed at sunrise, the second during the day, third at sunset and the last at night.<br />
Then, in a terminal, create a bash script as follows :</p>
<p><span style="color:#800000;"><code> gedit .change.sh </code></span></p>
<p>You’ll get the newly created .change.sh file opened in a text editor.<br />
Copy the following text in the file (Change the PATH-TO-**-PICTURE with the appropriate path) :</p>
<p><span style="color:#800000;"><code>#!/bin/bash<br />
HOUR=$(date +%H)<br />
case “$HOUR” in<br />
04|05|06|07)<br />
gconftool -t string -s /desktop/gnome/background/picture_filename PATH-TO-SUNRISE-PICTURE<br />
;;<br />
08|09|10|11|12|13|14|15)<br />
gconftool -t string -s /desktop/gnome/background/picture_filename PATH-TO-DAY-PICTURE<br />
;;<br />
16|17|18 )<br />
gconftool -t string -s /desktop/gnome/background/picture_filename PATH-TO-SUNSET-PICTURE<br />
;;<br />
*)<br />
gconftool -t string -s /desktop/gnome/background/picture_filename PATH-TO-NIGHT-PICTURE<br />
;;<br />
esac<br />
</code></span></p>
<p>As you can tell, this script sets the appropriate picture depending on the system’s current hour.<br />
Now we’ll create a cron job, which is a linux way to automatically run tasks.</p>
<p><span style="color:#800000;"><code>gedit .change.cron</code></span></p>
<p>This will open the text editor to edit our cron job.<br />
Copy the following in the text editor (Replace YOUR-HOME-FOLDER by your home folder’s absolute path):</p>
<p><span style="color:#800000;"><code>* 4,8,16,19 * * * YOUR-HOME-FOLDER/.change.sh</code></span></p>
<p>As you see, the cron task will lauch our previously created script at 4am, 8am, 4pm and 7pm to set the adequate wallpaper.<br />
(Of course, you can change the hours at your convenience).<br />
Now, let’s add these tasks to our gnome session so that they are automatically launched every time we login.<br />
Open the System&gt;Preferences&gt;Sessions menu.<br />
* Click the Add Button<br />
Name: Changing Wallpaper Cron<br />
Command: crontab PATH-TO-YOUR-HOME-FOLDER/.change.cron<br />
Click Ok<br />
Now the job of automatically changing wallpaper is set as an automated job every time we login.<br />
We also have to add the script at session startup so that the correct wallpaper is initialized when we login. (This means, that if you login at e.g. 5:30pm, you’ll have the right wallpaper for that time). To do that,<br />
* Click again the Add Button<br />
Name: Initializing Wallpaper<br />
Command: PATH-TO-YOUR-HOME-FOLDER/.change.sh<br />
Click Ok<br />
Here you are ! Your desktop wallpaper is living and reflecting the daytime!</p>
Posted in Linux Tagged: Automatically changing wallpaper relatively to daytime in Ubuntu <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aminesoft.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aminesoft.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aminesoft.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aminesoft.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aminesoft.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aminesoft.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aminesoft.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aminesoft.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aminesoft.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aminesoft.wordpress.com/208/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aminesoft.wordpress.com&blog=3705654&post=208&subd=aminesoft&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://aminesoft.wordpress.com/2009/03/05/automatically-changing-wallpaper-relatively-to-daytime-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b5b8cdacaf198c942a572c9b3b672c56?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Am!n3s0fT</media:title>
		</media:content>
	</item>
	</channel>
</rss>