We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

Command to lock device [answered]

asked 2015-07-10 02:38:09 +0300

AliN gravatar image

updated 2015-12-21 23:06:47 +0300

piero gravatar image

I know, with recent updates, double tap the power key will lock the device at once. But I prefer to do it via touch screen. It's easy to make a .desktop file, just I need a command for device lock and blank the screen.

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by AliN
close date 2015-08-13 13:37:10.532144

1 Answer

Sort by » oldest newest most voted
2

answered 2015-07-10 03:53:01 +0300

AliN gravatar image

I found the app Lock Device in Warehouse that does exactly what I want.

It uses the command sh -c "dbus-send --system --type=method_call --dest=org.nemomobile.lipstick /devicelock org.nemomobile.lipstick.devicelock.setState int32:1 & dbus-send --system --dest=com.nokia.mce --print-reply --type="method_call" /com/nokia/mce/request com.nokia.mce.request.req_display_state_off", but since I've had Ubuntu and seen gnome tools I think there should be simpler commands for that.

edit flag offensive delete publish link more

Comments

2

Using this app has a side effect: the process “lipstick” is renamed to “Device Lock”. Sounds strange.

AliN ( 2015-07-10 03:55:24 +0300 )edit

@AliNa, I don't quite understand what do you mean by lipstick process changiing name... at least nothing like that happens when you send the dbus message to it. Maybe the LockDevice application does something else strangeness?

Now, if it only would be possible to unlock the device using reverse of the dbus command :)

juiceme ( 2015-07-10 12:28:01 +0300 )edit

@juiceme, ok, you're right. Please let me rephrase: after using the Lock Device app, Memory app shows the lipstick process as Lock Device. I tried also Crest and Lighthouse; these two show the process correctly.

Lock Device app can't do anything, it's just an icon and a .desktop file which runs the command. So it may be the Memory app bug in getting the process names; e.g. getting the names from .desktop files, and here we have the name "Lock Device" for "org.nemomobile.lipstick". So while you have the Lock Device app, the lipstick will be named "Lock Device". Logical!

AliN ( 2015-07-10 13:58:35 +0300 )edit

Yeah! To solve the issue I made a bash file and pasted the command there. Then I did chmod +x and modify the lockdevice.desktop in order to execute the bash file instead. The problem of lipstick naming is solved now.

AliN ( 2015-07-10 15:40:20 +0300 )edit

I changed int32:0 and req_display_state_on and it just worked as display unlock.

Alfonso ( 2017-05-13 17:53:31 +0300 )edit

Question tools

Follow
3 followers

Stats

Asked: 2015-07-10 02:38:09 +0300

Seen: 776 times

Last updated: Jul 10 '15