View Single Post
Old 05-16-2014, 06:55 PM   #183
Cykotitan
Enthusiast
Cykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animals
 
Posts: 44
Karma: 6550
Join Date: May 2013
Location: Bosnia & Herzegovina
Device: Kindle Paperwhite 1 WiFi
Yes, I've just recently learned the meaning of ampersand symbol. The interpreter doesn't wait for the command to finish execution, but instead continues to the next section of code, something like that.

What appears to be the problem here is the script executing too soon, before the Kindle is able to render kindlemenupage.html, the task set by this code:
Code:
(usleep 250000; lipc-set-prop com.lab126.pillow customDialog '{"name": "../../../../mnt/us/extensions/kindlemenu/bin/kindlemenupage", "clientParams": {"dismiss": true}}') &
It appears the above job is delayed by 250 milliseconds!

So what happens if we delay the job responsible for starting clean_launchers.sh?
Code:
(usleep 300000; /mnt/us/extensions/kindlemenu/bin/sh/clean_launchers.sh ) &
The above code appears to execute the script right on time, I tried 250ms but it didn't work out after a cold boot - the script was firing up too soon again!

I would like to hear if there's a better way to achieve the same result, because this doesn't seem too robust (relying on the performance of the Kindle when timing background jobs). Does calling cleanup_launchers.sh via javascript once the DOM elements have loaded sound like a good idea?

Last edited by Cykotitan; 05-16-2014 at 07:03 PM.
Cykotitan is offline   Reply With Quote