Mce-tool: run custom action on power-key-double-click = emergency blocking of Fingerprint scanner

Since J doesn’t look into it, I had a thought on implementing disabling finger-print scanner on double-clicking the power button: currently it locks the device.

Powerkey press from display on:
        single                       blank,tklock
        double                       blank,tklock,devlock,vibrate
        long                         dbus1
...
Powerkey D-Bus actions:
        dbus1                        send signal with arg 'power-key-menu'
        dbus2                        send signal with arg 'event2'
        dbus3                        send signal with arg 'event3'
        dbus4                        send signal with arg 'event4'
        dbus5                        send signal with arg 'event5'
        dbus6                        send signal with arg 'event6'
        dbus7                        send signal with arg 'event7'
        dbus8                        send signal with arg 'event8'
        dbus9                        send signal with arg 'event9'
        dbus10                       send signal with arg 'event10'

Browsing through powerkey.c · master · mer-core / mce · GitLab I’ve noticed that there are some pwrkey_dbus_action[] actions than MCE could send.
Is that possible to make power-key-double-click send such an action, so that the daemon I write would listen to it and then kill finger-print scanner daemon?

Should work, right? Adding dbus5, for example, so double looks like blank,tklock,devlock,dbus5,vibrate

PS And we can even edit the exact signal
mcetool --set-powerkey-dbus-action=5,my-dbus-signal555

2 Likes

Hello
mcetool --set-display-on-double-powerkey-press-actions= blank,tklock,devlock,dbus5,vibrate

thank, but I’ve seen that.

Note to self: there is fpwakeup_set_allowed(), gotta listen on dbus, maybe we can send ‘disable fpwakeup’ on dbus from mce to mce with no need of additional daemon.

Sorry to revive a somewhat old thread, but seemed like the right place.
My intention is to use the double press feature (power button) to toggle the flashlight (on&off).
Im currently using the qml file where I have edited and assigned the shutter button to act as a flashlight toggle( and works much better than the flashlight top menu switch, where it fails to toggle like 80% of the time).

Would anybody know how to achieve that with mce tool?
It would be a much cleaner (and safer) approach.
Device is XA2

Sort of yes

The recipient needs to be
a) in case of signal action - something that is already running, connected to SystemBus and subscribed to mce signals
b) in case of method call action - it could also be autostart SystemBus dbus service

Literally killing the daemon might be counterproductive (systemd will restart it), but stopping sailfish-fpd systemd service should be possible as long as the listener is implemented in such a way that it has sufficient privileges to do that.

That is dealing with internal-to-mce state management, sort of mce saying “note to self: fpwakeups are now possible/not” i.e. it is not something directly visible/relevant to other processes.

The same requirements as above plus complications from (presumably) needing SessionBus access too. Any application connected SessionBus can also listen to signals in SystemBus - as long as it is already running. But on-demand autostart system service that also has SessionBus access - things get complicated fast. Naturally it can be done, but usually these are very singular creatures like systemui=compositor=lipstick.

2 Likes