Is there a way to prevent the phone from going to suspend when connected to bluetooth device such as bluetooth headphones or speaker ? This way wheh i am listening to music to prevent from going to sleep and when i disconnect the bluetooth device to follow the procedure in power options
Possibly not for “when connected to bluetooth device” but possibly, yes, for “running specific application” i.e. listening to music.
How can this be done for a specific applications ? With shockwave it doesn’t seem to work
The incantation that you are looking for is “inhibit suspend”.
It’s not the first time that someone has asked for it in respect of playing music: Suspend to honour audio streaming?
Here is discussion of inhibiting suspend around an SSH session but the basic command should be similar: Login via SSH && suspend - #10 by dos
You wouldn’t be doing it from a service however.
You would want to look at man gnome-session-inhibit
And to be clear … this would inhibit suspend while the music player is running. It won’t know whether you are actually listening or even whether the music player is actually playing anything.