Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

tip of the month in LXF66

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Magazine and coverdiscs
View previous topic :: View next topic  
Author Message
zsiga



Joined: Wed Dec 07, 2005 7:12 am
Posts: 2

PostPosted: Wed Dec 07, 2005 7:19 am    Post subject: tip of the month in LXF66 Reply with quote

Hey all, I'm a bit of a linux newcomer as you'll soon learn and I was having trouble getting the command image=`gawk -F\"'/href="image/{print$2;exit;}'$PGE` to work in the nasa desktop-a-day tip....everything was fine until that point. Also, if I don't use KDE and don't have dcop is there away to get the same result in gnome?
-Thanks
Back to top
View user's profile Send private message
graham
Site admin


Joined: Tue Apr 12, 2005 10:31 am
Posts: 37

PostPosted: Thu Dec 08, 2005 9:06 am    Post subject: RE: tip of the month in LXF66 Reply with quote

Morning!

Here's the script that I use at the moment (for KDE):

Code:

#!/bin/bash
TMP="/tmp"
SRC="http://antwrp.gsfc.nasa.gov/apod/"
PGE="astropix.html"
cd ${TMP}
wget --quiet $SRC$PGE
image=`gawk -F \" '/href="image/ { print $2; exit; }' $PGE`
wget --quiet $SRC$image
filename="${image##*/}"
cp -rf $TMP/$filename $HOME/.kde/share/background
dcop kdesktop KBackgroundIface setBackgroundEnabled false
dcop kdesktop KBackgroundIface setWallpaper $HOME/.kde/share/background 6
dcop kdesktop KBackgroundIface setBackgroundEnabled true
rm -rf $TMP/$filename
rm -rf $TMP/$PGE


To get this functionality in Gnome, you need to use something like gconftool-2 to change the background. For example, the following will change the background to /home/graham/background.png :

Code:
gconftool-2 --type str ---set /desktop/gnome/background/picture_filename /home/graham/background.png


It should be quite straighforward to adapt the KDE script, and you'll need to use 'cron' to run the script at a certain time. Let us know if you have a problem - if you get it to work, it would be great if you could post your script here!
Back to top
View user's profile Send private message
firefox



Joined: Mon Apr 11, 2005 12:21 pm
Posts: 64

PostPosted: Fri Dec 09, 2005 4:12 pm    Post subject: RE: tip of the month in LXF66 Reply with quote

That's quite a scary avitar, graham. Is it from something in particular? Surprised
Back to top
View user's profile Send private message
zsiga



Joined: Wed Dec 07, 2005 7:12 am
Posts: 2

PostPosted: Sat Dec 10, 2005 10:41 am    Post subject: Reply with quote

Well, due to a bit of overlooking the obvious I just got it.
Code:


#!/bin/bash
TMP="/tmp"
SRC="http://antwrp.gsfc.nasa.gov/apod/"
PGE="astropix.html"
cd ${TMP}
wget --quiet $SRC$PGE
image=`gawk -F \" '/href="image/ { print $2; exit; }' $PGE`
wget --quiet $SRC$image
filename="${image##*/}"
cp -rf $TMP/$filename $HOME/.gnome2/share/background.png
gconftool-2 --set /desktop/gnome/background/image_filename $HOME/.gnome2/share/background.png  --type str
gconftool-2 --type str --set /desktop/gnome/background/picture_options "stretched"
rm -rf $TMP/$filename
rm -rf $TMP/$PGE
 


The picture_options had to be set as well.

Thanks Graham!
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Magazine and coverdiscs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast