We have moved to a new Sailfish OS Forum. Please start new discussions there.

# Location of custom ambience from gallery ?

asked 2014-04-08 23:16:55 +0300

Someone know where saved ambience that you applied from one of the pictures in gallery ? The default and installed ambiences located here: /usr/share/ambience

but one that you applied from gallery is not here and I can't find it....

edit retag close delete

## Comments

I am not sure, what you mean. The Ambience image is not moved/copied (according to my understanding of the Ambience mechanisms). The settings are stored in a database (file path/name has been mentioned somewhere here on Together).

Temporary files are noted in this answer: https://together.jolla.com/question/16673/howto-ambiences/?sort=oldest#17984 (you should also check all the other answers to that question).

( 2014-04-09 00:22:20 +0300 )edit
1

@schturman perhaps it is this what you are looking for => https://together.jolla.com/question/36946/how-to-list-custom-ambiences/

( 2014-04-09 00:55:30 +0300 )edit

Thanks. What I want that apply my ambience via terminal command. I know how to do this with normal (original) ambiences when I need add this path to the command: /usr/share/ambience/NAME_OF_AMBIENCE_FOLDER/NAME_OF_AMBIENCE.ambience And I don't know how to do the same with custom ambience from gallery, because I don't know where the path to the: MY_CUSTOM_AMBIENCE.ambience saved.

( 2014-04-09 00:59:03 +0300 )edit

Kari, thanks...Will try to search in ambienced.sqlite file.

P.S. How to open/read this files ?

( 2014-04-09 01:02:07 +0300 )edit

@schturman: I suggest, running SQL commands against that file. However, this may not be possible from the Terminal directly.

Reading that file want solve your original problem: Activating a custom Ambience. I expect, you have to set the Ambience definitions at /desktop/jolla/theme/ using gconftool-2 (and hope that the new values are read automatically by Sailfish as soon as the UI draws some new elements on the screen; on gconftool-2 see for example http://ubuntu-tutorials.com/2008/01/10/gconftool-2-gconf-editor-from-the-shell/). Question remains, how you can work out the parameter/value combinations understood by Sailfish. Maybe thp can help you: He originally posted the gconftool-2 commands for color settings.

( 2014-04-09 01:08:54 +0300 )edit

## 2 Answers

Sort by » oldest newest most voted

answered 2014-04-09 11:40:02 +0300

This post is a wiki. Anyone with karma >75 is welcome to improve it.

The current Ambience proposal is WRONG and must be improved. For example: in case favorite Ambience, this must be copied to user local store - benefit: possibilities to modify system Ambiences settings, user Ambiences are not lost after SD card remove. Scenarios are more complex... Current proposal is useless, Jolla improve it please. :)

more

answered 2014-04-09 14:38:34 +0300

FIRST: Note here that I do not recommend this yet since I have not investigated consequences of changing ambience this way.. it might screw up the whole ambience system..

Got it, find out the ambience file picture file name using the method I provided in the comments to your question. When you have the file name, you can do this:

dbus-send --session --print-reply --dest=com.jolla.ambienced /com/jolla/ambienced com.jolla.ambienced.setAmbience string:"file://home/nemo/.cache/ambienced/com/jolla/components/bgimages/92607cd6hp.jpg"


Where the name of the pic is obviously the one you queried from the ambienced database.

Apparently ambience daemon also allows changing ambience by ambience picture file name, and not only by .ambience file :)

more

## Comments

Aha, changing ambience by that way, the ambience system does not recognize this as one of your custom ambiences and does not say the ambience name and ringerVolume on bottom of the homescreen, compared how it usually does if you change the ambience from the ambience UI. However, I noticed that when I used the original ambience image (and not the copy) instead, it showed the name and vol in bottom of homescreen when switching. I just don't know how to get the original path from ambienced.sqlite

( 2014-04-09 14:52:22 +0300 )edit

Ok, got the chain figured out. After you've found out the fileId of your ambience, you can query some more: e.g. If you have fileId 55, you can ask:

SELECT fileName, directoryId FROM file WHERE id="55";


and you get filename and directory index, in my case they are: 11948906235_e3e7ed6cbc_o.jpg|15 Now you know directory id and can ask the path:

SELECT path FROM directory WHERE id="15";


and I got: /home/nemo/Downloads Just combine path and file name and you got your ambience path :)

( 2014-04-09 15:02:06 +0300 )edit

And now just realized this wasn't even what you asked, the answer to your question was already there (custom ambiences in ambienced.sqlite). There some values like volume is rewritable, but e.g. color values are not. Also the db is accessible only with root privileges so it might be hard to run an app with user privileges and inspect / modify the db.

( 2014-04-09 15:07:55 +0300 )edit

WOW! Thanks for your workaround ! It's too much complicated for me now, maybe later I will try to add it to https://openrepos.net/content/schturman/auto-ambience-changer And it's a really answer for my question :)

( 2014-04-10 01:13:29 +0300 )edit

@schturman Well then, I'm glad I could help :)

Edit: You might want to also accept the answer, but I still keep you posted if I find some more simple way to do the same stuff.

( 2014-04-10 10:50:44 +0300 )edit

## Stats

Asked: 2014-04-08 23:16:55 +0300

Seen: 1,439 times

Last updated: Apr 09 '14