Use Ambience to trigger shell scripts

asked 2018-11-09 20:55:51 +0300

kayoux gravatar image

How to use ambience to triggering a shell? My objective is when I set a new Ambience, my script is launched to enable/disable wifi/bluetooth/airplane. my first intenssion was to use situations app command to launch the script however the command (sh /home/nemo/script/ do nothing. when I launch the same command in terminal the script do the job.

PS : I have read different old post related, but the solution don't work anymore

edit retag flag offensive close delete


Try the command using only the path /home/nemo/script/

Edz ( 2018-11-09 21:47:09 +0300 )edit

Remember that for several actions, it may be necessary to setup sudo because non-privileged users are not allowed to do such things.

Once set up correctly, this approach works perfectly fine on my Xperia X.

ziellos ( 2018-11-09 21:58:43 +0300 )edit

@Edz, I try but it's not work.

@ziellos, if I launch the script with terminal it's work (enable/disable wifi). Or I must write sudo in situations? May I forget some thing?

kayoux ( 2018-11-09 22:14:27 +0300 )edit

care to share your script @kayoux ?

Sorry, I've misread your question. You want to launch the script when an ambience is chosen and not launch it from terminal.

Edz ( 2018-11-09 22:34:02 +0300 )edit


My uggly script (when will it work i'll try to update to manage proprely the permission)

#active le bluetooth

#With password = your password

devel-su connmanctl enable bluetooth <<<"password"

#echo "lancé"

PS : yes it work when launch with terminal

kayoux ( 2018-11-09 22:39:16 +0300 )edit