Quote:
Originally Posted by NiLuJe
@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