Hebrew date need to change in the sunset
C library for Hebrew dates / times of day / solar times
Brought to you by:
boruch-baum,
kzamir
Hi Hatul,
Thanks for the note. It's nice to see libhdate being used. You
probably noticed that version 1.6 of libhdate has sunset-awareness in the command-line apps, but not in the program library - this was primarily to keep the API consistent with prior versions.
CONTENTS
a] What I did
b] What to do
c] a scripted solution
d] easier in version 1.8
e] an existing, packaged solution
a] What I did
What I did in order to have sunset-awareness for hdate and hcal was:
1] ask libhdate for the day's sunset
2] compare it to current time
3] if >, then ++ the julian date (or hebrew/gregorian day of month)
and ask libhdate for that day's date.
b] What to do
For a panel app, you'll probably want to add:
3.1] ask libhdate for the day's sunset
4] use the equivalent of linux's 'at' command to do the following at
sunset:
4.1] ++ the date
4.2] get tomorrow's sunset
4.3] schedule an 'at' for that time
I'm planning on doing this for conky and other apps, once I stop being
lazy and finish the final 5% of libhdate v1.8
c] a scripted solution
For sunset value:
hdate -tq | awk '/sunset:/{print $2}'
d] easier in version 1.8
The upcoming version 1.8 (already) includes command-line features to
hdate that allow you to get exactly the data you want, no more no
less, without having to pipe STDOUT through awk/sed etc to remove
cruff. For example
hdate -qqqq --sunset
will give you a response similar to
16:33
e] an existing, packaged solution
Steffan Vogel recently wrote a package to schedule cron jobs relative to sunset / sunrise. Your gnome-shell-extension could use that package, at least for now, in order to increment the Hebrew date
Last edit: Boruch Baum 2012-12-26