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

Switch ambiences via Situations app [answered]

asked 2015-09-29 20:17:58 +0300

Holger gravatar image

updated 2015-09-29 20:19:48 +0300

Did someone manage to switch ambiences via the Situations app? IMHO it would be logical, to use Situations for ambience switching... I found a thread on that topic here on TogetherJolla, but the suggested python script does not work (at least on 1.1.9). Edit: the mentioned thread wad https://together.jolla.com/question/88643/question-how-can-i-switch-ambiences-from-terminal/

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by Holger
close date 2015-10-01 12:47:16.154140

Comments

yeah, i've been wondeeing about this also. would like to change ambiances acording to the situation.

shfit ( 2015-09-29 21:04:31 +0300 )edit

@Holger,

See my original post. ;)

LVPVS over.

LVPVS ( 2015-09-29 21:32:46 +0300 )edit

1 Answer

Sort by » oldest newest most voted
5

answered 2015-10-01 12:33:23 +0300

Holger gravatar image

I'm posting an answer, just for completeness. LVPVS has provided a method via dbus-send in the question mentioned above, which works from the terminal. I created two scripts from that solution, one for each ambience I use. However these scripts cannot be called directly via the "command" method in Situations app, nothing happens. One needs to call a command like "bash -e /home/nemo/sw-amb-silent", works fine that way. Thanks all

edit flag offensive delete publish link more

Comments

@Holger could you provide your source here please? i can't represent myself to make it on my own after to read you. thank you so far.

cemoi71 ( 2015-10-06 15:43:31 +0300 )edit

@cemoi71: I have created a script named /home/nemo/sw-amb-harmony with this content:

dbus-send --session --type=method_call --print-reply --dest=com.jolla.ambienced /com/jolla/ambienced com.jolla.ambienced.setAmbience string:'file:///usr/share/ambience/harmony/harmony.ambience'

And also a similar script for the sailing ambience (replace "harmony" by "sailing" in the script and the name). Make the scripts executable. Then in the Situations app, add under "Command": bash -e /home/nemo/sw-amb-harmony respective bash -e /home/nemo/sw-amb-sailing, when you want to switch ambience. Note: this only works for the default ambiences, not for ambiences that you created yourself!

Holger ( 2015-10-09 21:03:16 +0300 )edit

Update: since v2.5.78 the Situations app has native support for ambience switching. Works fine here.

Holger ( 2015-11-06 15:15:03 +0300 )edit

Sorry to resurrect this old thread. Is there a possibility to also include custom Ambiences into the situations app? Or would I have to create my own scripts?

rod ( 2016-05-10 09:23:02 +0300 )edit

Question tools

Follow
2 followers

Stats

Asked: 2015-09-29 20:17:58 +0300

Seen: 514 times

Last updated: Oct 01 '15