xplanet-background

Rating: 
5
Your rating: None Average: 5 (4 votes)

Earth live rendering, updated every ten minutes, to be used as your
background home and application screen. Please check the configuration files
in /home/nemo/.config/xplanet for more options. Adding (realtime) cloud
coverage is supported (see below), displaying other Solar System objects, changing
viewing positions, angles and distances.
Please check /usr/share/xplanet/scattering/README for computing Rayleigh
scattering tables on the atmosphere (100 MB of data, disabled by default).

The live rendering is triggered with a systemd user service, "xplanet.service", that calls "xplanet" once to generate images into /home/nemo/Pictures/Jolla. You should ensure that this directory exists, it is not created automatically. These images are then used by two themes "xplanet" alternating one with each other to fake a dynamical background. This is triggered by a systemd timer every ten minutes, and should suspend automatically with your phone thereby preserving the battery.
At last, you can add (realtime) cloud coverage by adding manually a flat cloud map under the path:
/home/nemo/Pictures/Jolla/clouds.jpg. If not present, you'll get a cloudless Earth.

To desactivate xplanet-background, you should either uninstall it, or stop the timer:

systemctl --user stop xplanet.timer

To force the creation of the images at any time:

systemctl --user start xplanet.service

To check since when the last images have been created:

systemctl --user status xplanet.service

Enjoy!

Screenshots: 
Application versions: 
AttachmentSizeDate
xplanet-background-1.3.1-1.armv7hl.rpm6.08 KB03/05/2016 - 19:37
xplanet-background-1.3.1-2.armv7hl.rpm6.43 KB04/05/2016 - 15:03
xplanet-background-1.3.1-4.armv7hl.rpm6.76 KB05/05/2016 - 20:06
xplanet-background-1.3.1-5.armv7hl.rpm7.56 KB06/05/2016 - 15:33
xplanet-background-1.3.1-7.armv7hl.rpm9.21 KB12/09/2016 - 20:42
xplanet-background-1.3.1-8.armv7hl.rpm9.95 KB12/01/2017 - 00:20
Changelog: 

* Wed Jan 11 2017 Eatdirt <eatdirt@mageia.org> 1.3.1-8
- Workarounds to make the blurred application background
aspect-ratio.
- Remove any sound specification from the xplanet themes to avoid
overwriting user preferences.

* Mon Sep 12 2016 Eatdirt <eatdirt@mageia.org> 1.3.1-7

WARNING: Update only if you are running SailfishOS >= 2.0.2.51

- Ugly workarounds for circumvent bugs/crazy features of ambienced
introduced with Sailfish OS 2.0.2.51. In summary, Jolla does not want
you to touch the background pictures anymore. Two new themes created
are pushed one after each other every 10mn to fake updating the
background picture. Application picture is generated by Jolla, and is
not aspect ratio.

* Fri May 06 2016 Eatdirt <eatdirt@mageia.org> 1.3.1-5
- Change of timing method to optimize battery preservation. Now,
during suspend, xplanet should not generate any images. Replacing
'-wait 600' option within xplanet.sysconfig by '-num_times 1', setting
'oneshot' systemd service and reactivating every 10 minutes
xplanet.service using a new xplanet.timer
- Add glare 100 around the Sun for the background image. I find it nicer :)

* Thu May 05 2016 Eatdirt <eatdirt@mageia.org> 1.3.1-4
IMPORTANT: new maps uploaded (see below). If you have edited the files in /home/nemo/.config/xplanet before this update, they are not overwritten and xplanet-background & xplanet may not be able to find the new maps. Either have a look to the *.rpmnew files to fix it, or uninstall the previous version before installing this one.
- Fix redrawing to 10mn instead of 5mn to minimize battery draining
- Resampling all maps to 2048 pixels to minimize battery draining
- Package Hipparcos data to see a more starry background
- Package Solar System textures from flatplanet.sourceforge.net

* Wed May 04 2016 Eatdirt <eatdirt@mageia.org> 1.3.1-2
- Blurring and darkening apps background image for easier visibility
- Requires ImageMagick (convert)

* Wed Apr 27 2016 Eatdirt <eatdirt@mageia.org> 1.3.1-1
- Importing package xplanet, compiled without X11 support.
- Creating an background live theme based on it.

Comments

theyosh's picture

FYI: I have changed the size of the image to 2048x2048 pixels. As this is the image size off all other ambience pictures. Maybe update it in your script? The original size is for me to low, and shows black borders. It does not scale up.

Secondly I removed the xplanet name in /usr/share/ambience/xplanet/xplanet2.ambience file. Else every 10 min I see the name on my phone. Now it is 'hidden;

And you could add an extra script with the following contents and run it in the XPLANET_PREV variable. It will update the clouds every 3 hours:

#!/bin/sh
# more info https://github.com/apollo-ng/cloudmap/

PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
CLOUDS="/home/nemo/Pictures/Jolla/clouds.jpg"

# Get latest remote checksum
ORIGINSHA=$(wget https://raw.githubusercontent.com/apollo-ng/cloudmap/master/global.sha256 --no-cache -q -O - | awk {'print $1;'})

# Generate local checksum
if [ -e "$CLOUDS" ];
then
    LOCALSHA=$(sha256sum "$CLOUDS" | awk {'print $1;'})
fi

# Check if we're behind origin
if [ "${ORIGINSHA}" != "${LOCALSHA}" ];
then

    # Download raw global.jpg from master
    wget https://raw.githubusercontent.com/apollo-ng/cloudmap/master/global.jpg?${ORIGINSHA} --no-cache -q -O global.jpg

    # Generate checksum of downloaded file
    NEWSHA=$(sha256sum global.jpg | awk {'print $1;'})

    # Check if download's chksum corresponds to origin
    if [ "$NEWSHA" == "$ORIGINSHA" ];
    then
        mv global.jpg "$CLOUDS"
    else
        rm global.jpg
    fi
fi
theyosh's picture

Nevermind the resolution. I changed it to the screen resolution of my device. That works better.

eatdirt's picture

Thanks for the feedback and the script.

Yes, best picture is obtained by matching the screen resolution. I would even say that the png display is even better than jpg, but since a while, the ambienced of jolla does no longer support themes made in png, too bad.

For the clouds, I am doing almost the same, but with a cron job. I deciced to not provide it by default as, from past experience, cloud map servers have a tendency to disappear as soon as they become popular.

For those interested, in addition to the git repos pointed by theyosh, you can also generate your own cloud map from raw satellite data using:

CreateCloudMap

 

Cheers,

Chris.

anasofoz's picture

great job! I have 2 questions:

1)how to change ringer volume?

2)how to edit the background image since it appears too streched.

 

thanks keep up the great work.

eatdirt's picture

Hi, thanks.

1) For the ringer volume, the xplanet themes behave otherwise as normal themes, so you should be able to change it either within the ambience settings, or just with the volume buttons

2) If you refer to the "application" background image, the one which is blurred, I am still trying to figure it out. Since sailfish 2.0.2.51, jolla does not give any mean to change this picture anymore.

NB: If the "home" picture, the one which is not blurred, is streched, I suspect you are running xplanet on jolla C /tablet etc... I have only tested it under jolla 1

However, you can change the image resolution in

~/.config/xplanet/xplanet.sysconfig

the options -geometry 540x960

can be adujsted to the correc number of pixels of your phone / tablet. Then , it will be aspect ratio!

 

Cheers.

MrPancake's picture

Guya, how do I add clouds or change planets? Thank you in advance

eatdirt's picture

Hi,

there is no GUI setting app yet, so you have to manually edit that file:

/home/nemo/.config/xplanet/xplanet.sysconfig

XPLANET_PREV contains the command executed to create the background (the stars), and XPLANET_OPTIONS the command executed to display the object.

In there, you simply have to change "-body earth" to "-body saturn" or whatever you like.

All possible options are available in the man ("man xplanet" in a terminal), or check out the website at xplanet.sourceforget.net

For the clouds, that's easier, you just need to have a cloud map "clouds.jpg" in the directory:

/home/nemo/Pictures/Jolla

like this one:

http://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud_comb...

 

Hope it is clearer,

Cheers,

Chris.

Rikudou_Sennin's picture

very good work :)

eatdirt's picture

thanks :)

eatdirt's picture

Sorry about that. Which Sailfish version are you using? (I am on 2.0.0.10)

What is the output of:

systemctl --user status xplanet

Could you also check if you have "dconf" installed (maybe it is a missing Requires from my side).

dconf help

should give you some output.

 

 

Markkyboy's picture

No need to apologise :)

I'm using 2.0.1.11 (I forgot to take any notice of SFOS versions - this could be my problem).

dconf is indeed installed and working correctly to my knowledge, I use it quite regularly while tinkering.

Output from systemctl --user status xplanet;

[nemo@Jolla ~]$ systemctl --user status xplanet
xplanet.service - A live image generator of Solar System objects
   Loaded: loaded (/usr/lib/systemd/user/xplanet.service; enabled)
   Active: failed (Result: exit-code) since Wed 2016-05-04 22:57:54 BST; 1min 40s ago
  Process: 25385 ExecStart=/usr/bin/xplanet $XPLANET_OPTIONS -prev_command ${XPLANET_PREV} -post_command ${XPLANET_POST} (code=exited, status=1/FAILURE)
 Main PID: 25385 (code=exited, status=1/FAILURE)
   CGroup: /user.slice/user-100000.slice/user@100000.service/xplanet.service

Thanks, 

eatdirt's picture

@Markkyboy. That's weird, I don't really know what has been changed between 2.0.1.11 and 2.0.0.10 but I would not have expected to break it. If you're motivated enough to debug it, we could first check that the xplanet actually runs.

1) In a terminal could you check that

xplanet --version

returns something like this:

Xplanet 1.3.1
Copyright (C) 2012 Hari Nair <hari@alumni.caltech.edu>
The latest version can be found at http://xplanet.sourceforge.net
Compiled with support for:
        GIF
        JPEG
        PNG
        TIFF
        FreeType (version 2.4.9)

2) if yes, could you check if a image file, test.png, is actually produced by running:

xplanet -config /home/nemo/.config/xplanet/xplanet.conf -output test.png -num_times 1

3) if 1) and 2) are fine, then something is wrong with systemd service. Maybe jolla has changed the location of background pictures.

What is the output of (and does the path exist) of:

dconf list  /desktop/jolla/background/portrait/

dconf read /desktop/jolla/background/portrait/home_picture_filename

If everything is fine there, then I am clueless :-/

cheers.

Markkyboy's picture

1),
[nemo@Jolla ~]$ xplanet --version
Xplanet 1.3.1
Copyright (C) 2012 Hari Nair <hari@alumni.caltech.edu>
The latest version can be found at http://xplanet.sourceforge.net
Compiled with support for:
        GIF
        JPEG
        PNG
        TIFF
        FreeType (version 2.4.9)

==========================

2),
[nemo@Jolla ~]$ xplanet -config /home/nemo/.config/xplanet/xplanet.conf -output test.png -num_times 1
Warning: Resizing night map
For better performance, all image maps should be the same size as the day map
Warning: Can't find /home/nemo/Pictures/Jolla/clouds.jpg in
xplanet/images
/usr/share/xplanet/images
Warning: Can't load map file /home/nemo/Pictures/Jolla/clouds.jpg

Jolla folder in Pictures does not exist and a search for 'clouds.jpg' comes up negative.

===========================================

3),
[nemo@Jolla ~]$ dconf list  /desktop/jolla/background/portrait/
home_picture_filename
app_picture_filename

=======================================

3),..continued
[nemo@Jolla ~]$ dconf read /desktop/jolla/background/portrait/home_picture_filename
'/home/nemo/.cache/ambienced/com/jolla/components/bgimages/legacy/18bec94ahp.jpg'

So, images are missing it seems!

 

 

eatdirt's picture

Ah, here it is. That's ok to not have clouds.jpg (I did not ship it with the package as people may want to get it up-to-date) it is just a warning, but if you don't have the directory "Jolla" within Pictures, that prevents the images to be generated. The prog does not create it.

So if you just create the dir:

/home/nemo/Pictures/Jolla

then

systemctl --user restart xplanet

that should work! Let me know.

Markkyboy's picture

Bingo!, thanks man!, loving what I see so far, time to play!, thanks again for your help :)

eatdirt's picture

Great! You're welcome.

Markkyboy's picture

Doesn't work for me, tried 3 times now, but no joy. What am I missing here?