loknar299
Member
Jun 10, 2014
19
21
Apr 4, 2016 at 4:00 PM
#145
LPM how to
szymeczek34 said:
It used to be in here: /usr/share/jolla-camera/presets/GstOMXMPEG4VideoEnc-omxmpeg4videoenc.prs
Although that was a long time ago on version around 1.0.0.25, it could have changed since then.
Did you manage to get LPM working on OPX? I miss it so much.
Edit. Yep, it's gone.
Exactly, and i didn’t managed to find it anywhere else.
Well, LPM was (and in a way still is) tough nut to crack, but what i did:
Enabling LPM (in terminal under root)
Code:
mcetool --set-low-power-mode=enabled
After this it’s there, but only for several seconds, i also added it as reaction to powerkey press
Code:
mcetool --set-powerkey-blanking=lpm
And because i want it there all the time (unlike Jolla’s we have AMOLED’s so we can afford it battery wise) this is how to change timeout:
Code:
mcetool --set-blank-from-lpm-on-timeout=130
(It’s in seconds, I started with one day - 86400, but unfortunately it doesn’t update [time stays the same “forever”], so it’s kind of pointless)
So to address this, with help of some older sailfish OS forum posts i created configuration, that updates LPM every minute, but only when it’s already active (pretty much switching it off and on immediately, since i didn’t find out how to just refresh it )
It has three parts:
Code:
lpm.service
file, that determines what to run - lpm.sh script in my case,
Code:
lpm.service
should be placed in
Code:
/etc/systemd/system/
Code:
lpm.timer
file, that sets how often should lpm.service run, should also be placed in
Code:
/etc/systemd/system/
and also it needs to be activated
Code:
systemctl enable lpm.timer
and started (or you can reboot, then it of course starts automatically, since it’s activated)
Code:
systemctl start lpm.timer
and finally
Code:
lpm.sh
script, that checks, whether system is active or locked and update when necessary (has to be runnable [chmod +x lpm.sh] of course)
Unfortunately, so far LPM consumes battery a lot (something between 1-2 % per hour), for me it is acceptable, and also if you need to get longer life, just put it display down, since proximity sensor switches LPM off (then it’s more like 1 % down in three hours).
lpm.timer:
Code:
[Unit]
Description=LPM Update
[Timer]
OnCalendar=--* ::00
#This means that service with the same name (lpm) is activated every minute
[Install]
WantedBy=timers.target
lpm.service
Code:
[Unit]
Description=LPM refresh
[Service]
ExecStart=/root/lpm.sh
lpm.sh (very simple, i hope it can be done better way, but so far i don’t know how)
Code:
#!/bin/bash
if grep mce /sys/power/wake_lock >/dev/null 2>&1
#checks whether phone is awake
then
if /usr/sbin/mcetool | /bin/grep Inactivity | /bin/grep inactive >/dev/null 2>&1
#checks whether LPM is active
then
/usr/sbin/mcetool -d
#switches display on
/usr/sbin/mcetool --blank-screen-lpm
#switches back to LPM, but with updated time
fi
fi
Like
Reactions: kimmoli, elvarr, knauji and 1 other person