View Single Post
Old 06-29-2021, 08:05 PM   #65
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 876
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Quote:
Originally Posted by NiLuJe View Post
@WormGod: Something to that effect could possibly be cobbled up with the help of NickelDBus, but that's left as an exercise to the reader .

(I would probably *not* try to plug into NDB from within NanoClock, but just write a wrapper that starts/stops NanoClock at the required time. Or even keep it up and just pauses/unpauses the clock).
And here's a little example shell script as to how that could potentially be implemented. I haven't plugged any nanoclock stuff into this...

Code:
#!/bin/sh

# Check that qndb is available
command -v qndb >/dev/null 2>&1 || { printf >&2 "'qndb' not installed. Exiting"; exit 1; }

# We need to call ndbCurrentView first
qndb -m ndbCurrentView


while true; do
    new_view=$(qndb -s ndbViewChanged | cut -d " " -f 2)
    if [ "$new_view" = "ReadingView" ]; then
        # Do something useful
        printf "Reading View\n"
    else
        # Also do something useful
        printf "Not Reading View\n"
    fi
done
sherman is online now   Reply With Quote