[Dev] Ambiance changer, my first Sailfish OS app

When I got my hands on the Sailfish OS SDK, I immediately found it attractive. All the components are very pretty, and the UI was very well designed. Moreover, the SDK itself contained a lot of useful tools, and was very easy to use. It was during the MWC, and I had little time to play with it.

However, these days, I started to have fun with the distributed images. I’m not yet interested in porting the image to another device (like the Iconia tab), but did find some interesting stuff to keep me occupied. In fact, the SDK only provides one Ambiance, that is the one with the Sailfish background. Ambiance creation API are not yet exposed. However, this first ambiance comes from somewhere, so it might be possible to change it by triggering this 1st ambiance creation mechanism.

I want my ambiance !

I first started with gconf, and found interesting data, like the entries that are responsible of storing the color. However, I was also sad to find that the application background, with the diamond shape and blurred image, is somehow prebuilt, so I could not replace it with my background, and it would have been aweful.

However, I rapidely found that in /usr/share/themes/jolla-ambient/meegotouch/images/, there is that suspicious wallpaper.jpg file, and since it matches the one that is used as the homescreen background, it might have been used to generate the ambiance.

ambiancechanger simply performs that trick: it replace that file with the one you want, remove some entries in gconf, so that the process responsible of the homescreen (lipstick) finds that the ambiance is missing, then I reboot X (technically, I ask systemd to try to restart the graphical target), to regenerate the ambiance.

Of cause, on Jolla devices, ambiance changing will be way better, and this trick will not be needed.

So quick

It is amazing how quick you can develop for Sailfish. having enough Knowledge in Linux, and QML, I built the whole app in 2h, and the part that took me time was the tests, that are ran before getting to the app.

These tests are used to check if the user (nemo) is allowed to run some helper programs as root (responsible to change the background, and restart X), and since I was not very comfortable with sudo, I took much more time that usual in writing them.

The whole UI were written in QML, and was really easy to do. Important parts, like launching the helper tool to set the image, were done in C++, in simple QObject derived classes, and did not took much time either.

In fact, the SDK is even simpler than Harmattan’s one, that was already pretty simple to use. But it required some fiddle before working, and a lot of useful components had to be designed from scratch (application headers, for example). In contrast, everything just works out of the box in Sailfish, and the component set do not lack of major tools, for basic applications.

Here you can find a gallery of ambiances that I generated.

The best gadget feature

Ambiance is a gadget feature. It do not provide additional features that can enhance your experience with a phone. However, it is the most addictive gadget feature I have ever seen. It is basic and simple, it take one of your picture, and creates a color theme around it. It might feel boring, but when you get the ability to change theme, you immediately start to try all the photos / pictures you have to see which kind of colors it will extract, and how it will render.

Since yesterday, I found myself loading tons of photos inside the simulator, just to see which one to keep on the Jolla phone, and I never get bored. I’m often surprised, that some photos provides pretty beautiful ambiances, whereas some other ones, that should have been more promising, generates less beautiful ones.

Now I think that I get what Jolla people are saying. They want the phone to be easy to use, to be efficient, and to be fun. I never doubt about easiness and efficiency, but right now, I can feel the fun.

Downloads, contribute, have fun

If you are reading this blog post and did not downloaded the SDK, you should (even if that implies installing Linux). Visit sailfishos.org to get it.

You can get a premade RPM now, from my repository. Install it via SSH, or add the repo and use zypper.

Sources are open, as usual. There is no licence file yet, but everything is under BSD.

Advertisements

3 thoughts on “[Dev] Ambiance changer, my first Sailfish OS app

  1. Pingback: Ambiance: los temas de Sailfish OS - Movilinux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s