Reply
Thread Tools
Posts: 21 | Thanked: 49 times | Joined on Sep 2014 @ Italy, Rome
#1
Hi guys!!
I want to share with all of you a script made by me for download and apply the National Geographic Photo of the day..
It will auto download the new photo and will auto apply the photo as wallpaper on all 4 the screen of hildon home!!

1) You have to install bash3 from HAM or FAM
2) in X-Term type chsh and than, when you see
Code:
Login Shell [/bin/sh]:
type
Code:
/bin/bash
otherwise the script will not work
3) restart X-Term to have bash fully working..
4) type
Code:
sudo gainroot
and than
Code:
apt-get install wget
Now you are ready to download and use the script:

1) From x-term type
Code:
cd MyDocs/
Code:
mkdir photos
Code:
wget --no-check-certificate http://github.com/marcphemt/scrpts/raw/master/n900photooftheday.sh
2) When downloaded type
Code:
chmod +x n900photooftheday.sh
You have done!!

To execute the script type in x-term
Code:
cd MyDocs/
and
Code:
./n900photooftheday.sh
For new versions you have to download another time the same script with che same command and than chmod it!!

To add the icon and .desktop to hildon follow this instruction

1) Download zip attached, unzip it, and put files in MyDocs
2) With x-term as root type
Code:
cp /home/user/MyDocs/natgeo.png /opt/usr/share/icons/hicolor/64x64/hildon/
Code:
cp /home/user/MyDocs/natgeo.desktop /usr/share/applications/hildon
3) Reboot

For problems write here or pm me!!

Changelog 15/9/2014: Added the command to view the photo just downloaded with image-viewer...if you don't like the new photo of the day you have to simply close x-term!!
Changelog 16/9/2014: Added instruction to add icon to hildon
Changelog 19/9/2014: Cleaning up the code and added switch for those who use it with QueenBeeCon and corrected lines for file comparison (All thanks goes to Ilew and shawnjefferson)..Just download another time from github!! Cheers.
To Do:

1) Add graphic interface using zenity (i think).
2) Add an option to revert back the old wallpaper.

I ll tell you all changes with changelog..
Hope you like this script.

Cheers
Marcphemt
Attached Files
File Type: zip natgeo.zip (3.2 KB, 101 views)

Last edited by marcphemt; 2014-09-19 at 08:24.
 

The Following 9 Users Say Thank You to marcphemt For This Useful Post:
nokiabot's Avatar
Posts: 1,974 | Thanked: 1,834 times | Joined on Mar 2013 @ india
#2
Wow nice wallpapers everyday ! Also consider uploading to the repos later then maybe a gui or an icon to the script would do even better
 

The Following User Says Thank You to nokiabot For This Useful Post:
roflmaoo's Avatar
Posts: 53 | Thanked: 57 times | Joined on Jan 2012 @ Lithuania
#3
Nice new guy and already with the scripts! Keep it going
 

The Following User Says Thank You to roflmaoo For This Useful Post:
Posts: 21 | Thanked: 49 times | Joined on Sep 2014 @ Italy, Rome
#4
Thanks guys!! i m very happy that you like the script..
About graphic interface: I m planning to learn how to use zenity for a simple interface..hope i can learn something in few time eheheheheeheheheheh !!Than i ll learn about make a .deb file to install my works
 

The Following 2 Users Say Thank You to marcphemt For This Useful Post:
Posts: 21 | Thanked: 49 times | Joined on Sep 2014 @ Italy, Rome
#5
Hi guys, thanks for the comments...i m happy because you like my work...soon i ll post other works of mine!!
BTW now i m studing for the last exam for my veterinary university, so i don't have so much time to study for zenity...but i want to add a graphic interface to my works!! Thanks for the suggestions!!

Cheers

Marcphemt
 

The Following 2 Users Say Thank You to marcphemt For This Useful Post:
Posts: 21 | Thanked: 49 times | Joined on Sep 2014 @ Italy, Rome
#6
....don't know why, but i can't see my answers..
 

The Following User Says Thank You to marcphemt For This Useful Post:
Posts: 254 | Thanked: 509 times | Joined on Nov 2011 @ Canada
#7
I was taking a look at this and I'm not the strongest in shell scripting (so I could be wrong), but it looks like you aren't always using the PICTURE_DIR variable.

In the check if the picture already exists:
Code:
if [ ! -e ~/Immagini/${TODAY}_ngeo.jpg ]; then
In the preview code:
Code:
 /usr/bin/dbus-send --print-reply --dest=com.nokia.image_viewer /com/nokia/image_viewer com.nokia.image_viewer.mime_open string:file:///home/user/MyDocs/photos/${TODAY}_ngeo.jpg

in the code that sets the wallpaper:
Code:
	gconftool -s --type string /apps/osso/hildon-desktop/views/1/bg-image ~/MyDocs/photos/${TODAY}_ngeo.jpg
	gconftool -s --type string /apps/osso/hildon-desktop/views/2/bg-image ~/MyDocs/photos/${TODAY}_ngeo.jpg
	gconftool -s --type string /apps/osso/hildon-desktop/views/3/bg-image ~/MyDocs/photos/${TODAY}_ngeo.jpg
	gconftool -s --type string /apps/osso/hildon-desktop/views/4/bg-image ~/MyDocs/photos/${TODAY}_ngeo.jpg
also it looks like you are using ~/MyDocs/pic_url in one section of the code and /tmp/pic_url in another? probably /tmp/pic_url is the best place...
 

The Following 2 Users Say Thank You to shawnjefferson For This Useful Post:
Posts: 21 | Thanked: 49 times | Joined on Sep 2014 @ Italy, Rome
#8
You are right...i write this script for my pc and than converted for N900..so...thank you for reporting!! I ll correct this error as soon as possible!!
 

The Following 2 Users Say Thank You to marcphemt For This Useful Post:
Posts: 254 | Thanked: 509 times | Joined on Nov 2011 @ Canada
#9
PS, also the file size comparison doesn't work, at least on my system. wget returns a comma in the filesize and stat doesn't.

Feature request: how about adding a switch (-batch or -quiet or something) to run without prompting the user, so we can run it via a QueenBeeCon or other scheduled task?

Last edited by shawnjefferson; 2014-09-17 at 22:21.
 

The Following User Says Thank You to shawnjefferson For This Useful Post:
Posts: 21 | Thanked: 49 times | Joined on Sep 2014 @ Italy, Rome
#10
Originally Posted by shawnjefferson View Post
Feature request: how about adding a switch (-batch or -quiet or something) to run without prompting the user, so we can run it via a QueenBeeCon or other scheduled task?
Do you mean that you don't want the output? Or you don't want only the "press ENTER"?
Sorry, but for now i don't use queenBeeCon, so i don't know how it works..
Thanks for comment!!

EDIT: i'm working at the file comparison, and i see that don't work anymore..so i ll cancel that line...we don't need it beacause we don't have duplicates of the same photo..

Last edited by marcphemt; 2014-09-18 at 07:28.
 

The Following 2 Users Say Thank You to marcphemt For This Useful Post:
Reply

Tags
nokia n900, wallpapers


 
Forum Jump


All times are GMT. The time now is 21:10.