View Single Post
Old 09-29-2015, 06:08 PM   #8
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
I tried it. The problem is that the password check executable cannot read touch input while koreader has a lock on it. Since I do not speak lua, I cannot solve this.

EDIT: In case somebody wants to play around with this. This is what I did
Spoiler:
I modified \koreader\frontend\device\kobo\device.lua:
Code:
function Kobo:resume()
    os.execute("echo 0 > /sys/power/state-extended")
    os.execute("/mnt/onboard/.adds/kbmenu_user/scripts/tests/checkpw.sh")
    if self.powerd then
        if KOBO_LIGHT_ON_START and tonumber(KOBO_LIGHT_ON_START) > -1 then
            self.powerd:setIntensity(math.max(math.min(KOBO_LIGHT_ON_START,100),0))
        elseif self.powerd.fl ~= nil then
            self.powerd.fl:restore()
        end
    end

    Generic.resume(self)
end
checkpw.sh
Code:
#!/bin/sh

ksmroot=${ksmroot:-"/adds/kbmenu"}

pwfile="$ksmroot/kbbouncer/bouncerpw.txt"
if [ -e $pwfile ] && [ "$($ksmroot/onstart/checkbouncerinstall.sh)" == "ok" ]; then
  export KBBouncerMode=
  bouncer=$ksmroot/kbbouncer/kbbouncer.sh
  pw=$(cat $pwfile)
  answer=""
  pwcount=0
  while [ "$answer" != "passed" ] && [ $pwcount -lt 3 ]; do
    answer=$($bouncer "$pw")
    let pwcount++
  done
  if [ "$answer" == "failed" ]; then
    $ksmroot/onstart/poweroff.sh
  fi
fi
Be aware that this does NOT work. You will be offered the password check, but you cannot enter the password!

Last edited by tshering; 04-24-2016 at 07:37 AM.
tshering is offline   Reply With Quote