Hacker News new | past | comments | ask | show | jobs | submit login

Use "aa" from the astronomical-almanac package to calculate the value, then feed it into i3status.

Here's the current distance to Mars in AU:

  date  +"%Y%n%m%n%d%n%H%n%M%n%S%n1%n1%n4" |\
  aa|\
  sed -n '/distance/s/.*\([0-9]\.[0-9]* au\).*/\1/p'
And here it is in light minutes (useful for Skype!)

  date  +"%Y%n%m%n%d%n%H%n%M%n%S%n1%n1%n4" |\
  aa |\
  sed -n '/light time/s/,.*//p'



Much appreciated. Didn't know about aa.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: