Shake phone to turn on the flashlight

Hi, I couldn’t find a signal which is emitted when the phone is shaken.

Could you please implement an option to turn on the flashlight when the phone is shaken? Or at least provide a signal.

Thanks

8 Likes

A gesture of my Moto G9, which I really like :-).

1 Like

https://forum.sailfishos.org/t/how-to-get-qaccelerometer-working/10888

Thanks! You’ve pointed me in the right direction.

What I need is the shake gesture provided by the QtSensor plugins which Jolla already ships :muscle:

I’ve already made the app I need :slight_smile:

1 Like

This is a nice idea for an application. I tried to install it from OpenRepos. (I couldn’t find it on Chum by the name “ShakeTorch”.)

Maybe i’m doing something wrong, but it doesn’t work. Lots of shakes, no torch. Any ideas?

I don’t know the best way to turn on the flashlight. In the end I’ve opted for the com.jolla.settings.system.flashlight dbus call. Either that isn’t working or the system user service didn’t start.

Alternatively you can

...
import com.jolla.settings.system 1.0

Foo {
  Flashlight { id: flashlight }

  onSomeEvent:   flashlight.toggleFlashlight()
}

Although I assume that’s just the same as the dbuscall internally.

Same same. Looking forward to this working though :slight_smile:

May i inquire, why is this in OpenRepos if it isn’t even supposed to work? Or why does it not say it in the description, like “work in progress, maybe the next version turns the light on”…

I’m just a little frustrated after installing it and shaking my phone around like a moron with various manoeuvres just to find out that this is a non-working app. That’s all.

Well, maybe because I thought it was working?

Anyway, it doesn’t work for me this morning either and I suspect there’s some problem with the DBus connection. A restart of the systemd service fixes it.

1 Like

I understand your frustration, but it’s quite something when ilpianista invests his time to build an app for free and this is the reaction he receives. Not very motivating is it? Kudos you did this ilpianista! Hope you get it to work, soon :slight_smile: -)

2 Likes

Maybe you’ll understand my reaction better when you realize that i thought the app was released as non-working and unfinished (shake gesture not implemented or something). I honestly thought that WTF is this guy doing and I didn’t realize that it was supposed to work as intended.

I didn’t mean to hurt anyone let alone ilpianistas feelings, and i apologize for that.

Edit: @ilpianista, i hope you get the app working. As i said, it is a nice idea, and it would definitely become handy.

I accept your apology and thank you for your understanding!

May you please try version 0.2 and let me know? From my tests, the problem seems to be solved :crossed_fingers:

4 Likes

Thanks, works like a charm!

Apparently, it takes only one snappy shaking motion to turn the flashlight on and another one to turn it off. This is such a nice feature to have, I hope it will be adopted to the OS itself somewhere in the future.

2 Likes

At the moment it does not work when the screen is off. This is a limitation of the Qt Shake Gesture plugin, but I can patch it if we need this functionality as well :innocent:

2 Likes

Fantastic feature, thanks ilpianista

2 Likes

First of all: Nice! Thanks so much! :wink:

i have a feature proposition: how about a switch in the settings app? Bc i dont want to have it enabled all the time, but dont wanna un/reinstall all the time :slight_smile:

3 Likes

Zing! Can confirm it works - pretty bright too.
Thanks!

Really nice app, thank you. However I observe strongly increased consumption of charge, is it the same for other users?

Not really, power consumtion hasn’t really changed on my device. At least when torch is off. :wink:

1 Like