Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: HOWTO: XPlanet

  1. #1
    Join Date
    Jun 2005
    Beans
    Hidden!

    HOWTO: XPlanet

    First of all, XPlanet displays the current daylight conditions in the world, as you desktop background.

    Screenshot


    First of all, install XPlanet:
    Code:
    $ sudo apt-get install xplanet

    Once installed, you have two options:

    1) Navigate to the xplanet folder and download some images to use for XPlanet. You will need to replace USERNAME with your user name.

    Code:
    $ cd /home/USERNAME/.xplanet/images/
    $ wget http://visibleearth.nasa.gov/images/2433/land_shallow_topo_2048.jpg
    $ mv land_shallow_topo_2048.jpg earth.jpg
    $ wget http://visibleearth.nasa.gov/images/1438/earth_lights_lrg.jpg
    $ mv earth_lights_lrg.jpg night.jpg
    or

    2) Install xplanet-images (thanks to mike998 for the info):

    Code:
    $ sudo apt-get install xplanet-images
    Next, we need to stop nautilus from controlling the desktop:
    Applications > System Tools > Configuration Editor
    In the Configuration Editor, go to apps > nautilus > preferences and untick "show_desktop".

    Finally, we need to start XPlanet when we log in:
    System > Preferences > Sessions
    Click on the "Startup Programs" tab, and click on "Add". Enter "xplanet" (without the quotes) into the "Startup Command" text box, and click OK.

    Log out and back in, and you should see an image of earth as your background.
    Last edited by Psycho275; July 16th, 2005 at 06:46 PM. Reason: Added xplanet-images package details.

  2. #2
    Join Date
    Nov 2004
    Location
    Ottawa, Canada
    Beans
    Hidden!
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: XPlanet

    You can install the xplanet-images package if you want rather than downloading the pictures.

    Good how-to - it was the not displaying background that I had missed previously.

  3. #3
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: HOWTO: XPlanet

    Quote Originally Posted by mike998
    You can install the xplanet-images package if you want rather than downloading the pictures.
    I saw the package when looking for xplanet, but didn't mention it as I haven't tried it yet.

    Quote Originally Posted by mike998
    Good how-to - it was the not displaying background that I had missed previously.
    Thanks - It took me a little while to figure out how to hide the background. One problem with not allowing nautilus to control the desktop is that it will no longer show icons for removable devices on the desktop automatically, so I now use "Computer" through Nautilus instead to access it.

  4. #4
    Join Date
    Nov 2004
    Location
    Nyack NY USA
    Beans
    988
    Distro
    Ubuntu Development Release

    Re: HOWTO: XPlanet

    To avoid losing my desktop icons I don't use the nautilus change you mention and use instead this script which works with gnome2

    http://stef.tvk.rwth-aachen.de/~nazgul/linux-hacks.php

    Great idea btw!

  5. #5
    Join Date
    Nov 2004
    Location
    Nyack NY USA
    Beans
    988
    Distro
    Ubuntu Development Release

    Re: HOWTO: XPlanet

    Actually for some reason the script borks so ignore my previous post

  6. #6
    Join Date
    Nov 2004
    Location
    Nyack NY USA
    Beans
    988
    Distro
    Ubuntu Development Release

    Re: HOWTO: XPlanet

    This one works better (you need python installed:


    #!/usr/bin/env python

    # Script for handling xplanet in Gnome
    # Add this script to your "Startup Programs" in the "Sessions" control center applet

    import sys, os, time, glob

    def main(argv):
    #we use /tmp to store image files
    originalFilename = '/tmp/xplanet-original.png'

    if len(argv) > 1: #called in update mode
    # At this point, there will be a two images in /tmp
    # We'll delete the old one, and rename the new one
    for f in glob.glob('/tmp/xplanet-background-*.png'):
    os.remove(f)
    #filename includes a timestamp
    background = '/tmp/xplanet-background-%d.png' % int(time.time())
    #rename the newly generate image
    os.rename(originalFilename, background)

    #now set the background to the new image (by modifying your gconf database)
    os.system('gconftool-2 -t str -s /desktop/gnome/background/picture_filename "%s"' % background)
    return

    #called in startup mode, set up and start xplanet

    #set some options, change here to suit your desires
    options = '-geometry 1600x1200 -longitude -74 -latitude 41'

    #start xplanet niced
    #refresh every 5 minutes, sleep if inactive for 10
    #name output image, will get renamed
    #re-call this script in update mode after rendering a new image
    #run this in the background so the script will exit
    startxplanetcommand = '/usr/bin/nice -19 xplanet -wait 300 -hibernate 600 -output %s %s -post_command "handle-xplanet.py update" &' %
    (originalFilename, options)
    os.system(startxplanetcommand)

    if __name__ == '__main__':
    main(sys.argv)


    You may wish to change the latitude and longtude if you don't live in New York

    Then to get it to work:

    sudo cp handle-xplanet.py /usr/bin

    then (as above)

    System > Preferences > Sessions
    Click on the "Startup Programs" tab, and click on "Add". Enter "handle-xplanet.py" (without the quotes) into the "Startup Command" text box, and click OK

    You may also need to reboot to eliminate previous xplanet instances.

    Sorry to hijack the thread

  7. #7
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: HOWTO: XPlanet

    Thanks very much for that, kleeman - I'll give it a go tomorrow (it's getting late here!). Don't worry about hijacking the thread - it's useful information!

  8. #8
    Join Date
    Jul 2005
    Location
    New York
    Beans
    57

    Re: HOWTO: XPlanet

    I don't believe your post maintained the necessary indentation required to run the Python script

    Could you possibly provide it as a file?

    Also this problem occurs:

    Code:
      File "/usr/bin/handle-xplanet.py", line 36
        startxplanetcommand = '/usr/bin/nice -19 xplanet -wait 300 -hibernate 600 -output %s %s  -post_command "handle-xplanet.py update" &' %
                                                              ^
    SyntaxError: invalid syntax
    Last edited by Sephiriz; July 17th, 2005 at 07:16 PM.

  9. #9
    Join Date
    Jun 2005
    Beans
    Hidden!

    Re: HOWTO: XPlanet

    Quote Originally Posted by Sephiriz
    I don't believe your post maintained the necessary indentation required to run the Python script

    Could you possibly provide it as a file?

    Also this problem occurs:

    Code:
      File "/usr/bin/handle-xplanet.py", line 36
        startxplanetcommand = '/usr/bin/nice -19 xplanet -wait 300 -hibernate 600 -output %s %s  -post_command "handle-xplanet.py update" &' %
                                                              ^
    SyntaxError: invalid syntax
    I came across that error too, Sephiriz. I discovered removing the percentage symbol (%) from the end of the line stopped the error occuring, but also seemed to stop the script working too.

  10. #10
    Join Date
    Nov 2004
    Location
    Nyack NY USA
    Beans
    988
    Distro
    Ubuntu Development Release

    Re: HOWTO: XPlanet

    Sorry about that I tried to upload it directly and the uploader would only accept certain files. Anyway here it is as a zip file

    move it (as root) to /usr/bin and also

    sudo chmod a+x handle-xplanet.py
    Attached Files Attached Files

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •