Active Topics

 


Reply
Thread Tools
Posts: 1,067 | Thanked: 2,383 times | Joined on Jan 2012 @ Finland
#11
#!/bin/sh
/usr/bin/gconftool-2 --type=int --set /system/osso/dsm/display/inhibit_blank_mode 3
/usr/bin/gconftool-2 --type=int --set /schemas/system/osso/dsm/display/inhibit_blank_mode 3
/usr/bin/gconftool-2 --type=int --set /system/osso/dsm/display/display_blank_timeout 600000000
/usr/bin/gconftool-2 --type=int --set /schemas/system/osso/dsm/display/display_blank_timeout 600000000
/usr/bin/gconftool-2 --type=int --set /system/osso/dsm/display/display_dim_timeout 600000000
/usr/bin/gconftool-2 --type=int --set /schemas/system/osso/dsm/display/display_dim_timeout 600000000
/usr/bin/gconftool-2 --type=bool --set /system/osso/dsm/locks/touchscreen_keypad_autolock_enabled false

This only works if you do not have mail for exchange setup with forced values. There is a way to disable the timeout force on mfe too, but that requires you to hack devicelockd and clear the force bits, so that is another story and too complicated for most people to do.
__________________
IRC: jonni@freenode
Sailfish: ¤ Qt5 SailfishTouchExample ¤ Qt5 MultiPointTouchArea Example ¤ ipaddress ¤ stoken ¤ Sailbox (Dropbox client) ¤
Harmattan: ¤ Presence VNC for Harmattan ¤ Live-F1 ¤ BTinput-terminal ¤ BabyLock ¤ BabyLock Trial ¤ QML TextTV ¤
Disclaimer: all my posts in this forum are personal trolling and I never post in any official capacity on behalf of any company.
 

The Following 3 Users Say Thank You to rainisto For This Useful Post:
Posts: 138 | Thanked: 144 times | Joined on Oct 2012 @ Devon, England
#12
The thing with the above is that it will also mean having a screen that will never timeout at all, so you have to lock it manually all the time.

I was looking for a setting like in Settings>Security>Device lock>Autolock, where you can adjust the time before the security lock engages without changing the screen timeout (which I think is what solbrit was looking for, if not the OP).
 
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#13
Thankyou for replying rainisto!

As Eztran points out it is a drawback though that this adresses the problem by changing the screen timeout settings...

It's a shame that this isn't as easy as on the N900 where you could change the devicelock-autolock timeout to whatever you liked. I actually prefer the devicelock kicking in after a while, but one hour is too short.
 
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#14
And btw, if you set the screen to never timeout as suggested and lock it manually you'll still get the security lock after x minutes as usual...
 
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#15
I just stumbled upon this.

http://talk.maemo.org/showthread.php?t=83603

With a way to enable the security lock from command line it's easy to write a script to check if the screen is locked (or one that checks for screen input, if you prefer) for x time and if true enable the security lock, and have the script run a constant loop.

Code:
#!/bin/bash

/usr/bin/devicelock-enable --lock-screen

# Sleep time 20 --> 3 lines/minute if screen locked
while true; do sleep 20 &&

if dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.get_tklock_mode|awk -F "\"" '/g/ {print $2}' | grep -q 'unlocked' 

then
> /path/to/sec-lock.log

else
echo "Screen locked..." >> /path/to/sec-lock.log

fi

# Check if sec-lock.log is full (3 lines/minute --> 120 minutes = 360 lines)
if [ 360 -eq "$(wc -l < /path/to/sec-lock.log)" ]

then
> /path/to/sec-lock.log && /usr/bin/devicelock-enable --lock-screen

fi;

done
This will enable the security lock once initially and then keep locking it after two hours if the screen isn't unlocked during that time. You can use it in /etc/init/apps to enable it from boot (what OP was going for would be running only the first line on boot).

Last edited by solbrit; 2013-02-13 at 09:19.
 
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#16
This might be a bit more interesting. It enables the security lock after 30 minutes if the phone's neither charging nor connected through wifi, both of which only occur, in my case, when at home.

Code:
#!/bin/bash

# Enable device lock on boot
/usr/bin/devicelock-enable

# Sleep time 20 --> 3 lines/minute if discharging, not connected to wlan and screen locked
while true; do sleep 20 &&

if
lshal | grep -q 'battery.rechargeable.is_charging = true'

then
> /opt/sec-lock/sec-lock.log

elif dbus-send --system --type=method_call --dest="com.nokia.mce" --print-reply "/com/nokia/mce/request" com.nokia.mce.request.get_tklock_mode|awk -F "\"" '/g/ {print $2}' | grep -q 'unlocked' 

then
> /opt/sec-lock/sec-lock.log

elif /usr/sbin/iw dev wlan0 link | grep -q 'Connected to'

then
> /opt/sec-lock/sec-lock.log

else
echo "Screen locked..." >> /opt/sec-lock/sec-lock.log

fi

# Check if sec-lock.log is full (3 lines/minute --> 30 minutes = 90 lines)
if [ 90 -eq "$(wc -l < /opt/sec-lock/sec-lock.log)" ]

then
> /opt/sec-lock/sec-lock.log && /usr/bin/devicelock-enable

fi;

done
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:37.