|
|
2013-02-02
, 14:40
|
|
Posts: 138 |
Thanked: 144 times |
Joined on Oct 2012
@ Devon, England
|
#12
|
|
|
2013-02-02
, 20:22
|
|
|
Posts: 126 |
Thanked: 59 times |
Joined on Jan 2011
|
#13
|
|
|
2013-02-08
, 16:20
|
|
|
Posts: 126 |
Thanked: 59 times |
Joined on Jan 2011
|
#14
|
|
|
2013-02-10
, 09:26
|
|
|
Posts: 126 |
Thanked: 59 times |
Joined on Jan 2011
|
#15
|
#!/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
|
|
2013-03-29
, 01:38
|
|
|
Posts: 126 |
Thanked: 59 times |
Joined on Jan 2011
|
#16
|
#!/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
/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.