Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Script][N900][19/9/2014] NatGeo photo of the day script.

    Reply
    Page 1 of 2 | 1   2   | Next
    marcphemt | # 1 | 2014-09-15, 12:06 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: zip natgeo.zip (3.2 KB, 100 views)

    Last edited by marcphemt; 2014-09-19 at 08:24.
    The Following 9 Users Say Thank You to marcphemt For This Useful Post:
    freemangordon, imaginaryenemy, nikname, nokiabot, pichlo, roflmaoo, rotoflex, whayong, Wikiwide

     
    nokiabot | # 2 | 2014-09-15, 12:43 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to nokiabot For This Useful Post:
    Wikiwide

     
    roflmaoo | # 3 | 2014-09-15, 12:54 | Report

    Nice new guy and already with the scripts! Keep it going

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to roflmaoo For This Useful Post:
    Wikiwide

     
    marcphemt | # 4 | 2014-09-15, 13:05 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to marcphemt For This Useful Post:
    nokiabot, Wikiwide

     
    marcphemt | # 5 | 2014-09-15, 16:24 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to marcphemt For This Useful Post:
    nokiabot, Wikiwide

     
    marcphemt | # 6 | 2014-09-16, 16:55 | Report

    ....don't know why, but i can't see my answers..

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to marcphemt For This Useful Post:
    Wikiwide

     
    shawnjefferson | # 7 | 2014-09-17, 21:39 | Report

    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...

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to shawnjefferson For This Useful Post:
    marcphemt, Wikiwide

     
    marcphemt | # 8 | 2014-09-17, 21:47 | Report

    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!!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to marcphemt For This Useful Post:
    nokiabot, Wikiwide

     
    shawnjefferson | # 9 | 2014-09-17, 22:17 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by shawnjefferson; 2014-09-17 at 22:21.
    The Following User Says Thank You to shawnjefferson For This Useful Post:
    Wikiwide

     
    marcphemt | # 10 | 2014-09-18, 07:15 | Report

    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..

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by marcphemt; 2014-09-18 at 07:28.
    The Following 2 Users Say Thank You to marcphemt For This Useful Post:
    pichlo, Wikiwide

     
    Page 1 of 2 | 1   2   | Next
vBulletin® Version 3.8.8
Normal Logout