Lock/Unlock Sound

My old Nokia Lumia Smartphone had played Systemsounds when locking/unlocking it. (Waterdrop like sound when unlocking and a doorlock sound when locked)

In some Situations this is very helpful to know, specially when unlocking it in the bag while hearing music over Bluetooth and you know that your phone is accidentially unlocked and random screen presses can occur.

So my dear Withsailors the big question here for me is:

Where to configurire it?
And when its not supported maybe this is a fearure-request worth?

1 Like

It looks like it should be possible to hack up something.

/usr/share/lipstick-jolla-home-qt5/lockscreen/LockScreen.qml has

        NonGraphicalFeedback {
            id: unlockSuccessfulEvent
            event: "unlock_device"
        }

So one could hook into that unlock_device event to play a sound.

These events are configured at /usr/share/ngfd/events.d and there is a file unlock_device.ini for this event.

According to this users should be able to place files in /etc/ngfd to override the defaults.

The remaining question is which magic words need to be added to that file so it plays a sound.

I tried creating /etc/ngfd/events.d/unlock_device.ini

[unlock_device]
haptic.type = event
haptic.effect = strong
canberra.filename = toh_attach
sound.volume.profile = touchscreen.sound.level =>  sound.volume
sound.stream.media.name = feedback-event
sound.stream.module-stream-restore.id = x-feedback-sound-level

and restarted ngfd, but it does not seem to work.

2 Likes

Ahah!

This one works for unlocking at least:

/etc/ngfd/events.d/unlock_device.ini

unlock_device=> context@call_state.mode == none]
canberra.filename = toh_attach
sound.volume.profile = touchscreen.sound.level => sound.volume
sound.stream.media.name = feedback-event
sound.stream.module-stream-restore.id = x-feedback-sound-level
haptic.type = event
haptic.effect = strong

[unlock_device]
sink.null = empty

Do a systemctl --user restart ngfd after creating the file, and unlock your device.

If you want it louder you can remove the sound.volume.profile line and use instead:

sound.stream.media.name = system-event
sound.stream.module-stream-restore.id = x-ringtone-volume

or

sound.stream.media.name = system-event
sound.stream.module-stream-restore.id = x-media-playback-volume
5 Likes