View Single Post
Old 03-27-2014, 05:50 PM   #14
peterson
Connoisseur
peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.
 
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
Quote:
Originally Posted by Hades77 View Post
I now have thought about 2 different approaches to that:

1. modifying onlinescreensaver itself
a) specify two veriables in config.sh
Code:
# Timeframe within which update is disabled, define same time to always update
SLEEPBEGIN=2300    # no update after 23:00
SLEEPEND=0730      # and before 7:00
You should not use numbers that start with 0, in my experience this leads to problems as they are interpreted as octal numbers. Try running

Code:
echo $((0730+0))
and the output will not be 730 but 472 (which is 730 in octal, i.e. 7*8*8 + 3*8 + 0)

Quote:
b) insert the following code in update.sh (before loading utils.sh)
Code:
# do nothing if in sleep timeframe
HOUR=$(date +%H%M)
if [ \( $SLEEPBEGIN -gt $SLEEPEND -a \( $HOUR -ge $SLEEPBEGIN -o $HOUR -le $SLEEPEND \) \) -o \
     \( $SLEEPBEGIN -lt $SLEEPEND -a \( $HOUR -ge $SLEEPBEGIN -a $HOUR -le $SLEEPEND \) \) ]; 
then
  exit
fi
this has the disadvantage that even manual updates are blocked
The correct solution is to define a schedule (compare my other extension that manages the frontlight depending on time of day) and then calculate in schedule.sh how long to wait. No updates to update.sh should be necessary.

If you can wait a few days, I can add this to the online screensaver extension. I'm just a bit swamped right now with work.

Quote:
It seems that the cronjobs are executed and calling the disable.sh at 21:15 and enable.sh at 21:28.
Between 21:15 ans 21:28 under KUAL-->onlinescreensaver I can see "enable auto-download" which should tell me that auto-download is currently disabled.
There was a typo in the conf file, where the running schedule.sh script would not be killed (it tried to kill scheduler.sh.sh and not scheduler.sh). Just download the zip file again, call disable and enable and afterwards it should work. Sorry for the problem.

Last edited by peterson; 03-27-2014 at 05:53 PM.
peterson is offline   Reply With Quote