obsd-bkp/dotfiles/dotfolder/.local/bin/thelemic-date

71 lines
2.3 KiB
Bash
Executable File

#!/usr/bin/env sh
# Vars
_dayw=$(date "+%a") ## Day of the week
_daym=$(date "+%d") ## Day of the mounth
_mounth=$(date "+%m") ## Mounth number
_year=$(date "+%Y") ## Current year
_year_zero="1904"
_year_diff="$(echo "${_year} - ${_year_zero}" | bc)"
_year_cicles="$(echo "scale=0; ${_year_diff} / 22" | bc)"
_year_cur_cicle="$(echo "${_year_diff} - (${_year_cicles} * 22)" | bc)"
#_zone="-z +2" ## Time zone
_lat="35.922318399657875"
_log="14.381111311157396"
#_coord="-zl ${_log} ${_lat}"
_sun="$(astrolog -n ${_zone} ${_coord} | head -4 | tail -1 | awk '{print $3}' | sed 's/[0-9]//g')"
_sun_pos="$(astrolog -n ${_zone} ${_coord} | head -4 | tail -1 | awk '{print $3}' | ghead -c 2 | sed 's/[A-Z]//')"
_moon="$(astrolog -n ${_zone} ${_coord} | head -5 | tail -1 | awk '{print $2}' | sed 's/[0-9]//g')"
_moon_pos="$(astrolog -n ${_zone} ${_coord} | head -5 | tail -1 | awk '{print $2}' | ghead -c 2 | sed 's/[A-Z]//')"
case $_sun in
"Aqu") _sun_done="Acquario";;
"Gem") _sun_done="Gemelli";;
"Sag") _sun_done="Sagittarii";;
"Tau") _sun_done="Toro";;
"Ari") _sun_done="Ariete";;
"Pis") _sun_done="Pesci";;
"Cap") _sun_done="Capricorno";;
"Can") _sun_done="Cancro";;
"Sco") _sun_done="Scorpione";;
"Lib") _sun_done="Bilancia";;
"Leo") _sun_done="Leone";;
"Vir") _sun_done="Vergine";;
esac
case $_moon in
"Aqu") _moon_done="Acquario";;
"Gem") _moon_done="Gemelli";;
"Sag") _moon_done="Sagittarii";;
"Tau") _moon_done="Toro";;
"Ari") _moon_done="Ariete";;
"Pis") _moon_done="Pesci";;
"Cap") _moon_done="Capricorno";;
"Can") _moon_done="Cancro";;
"Sco") _moon_done="Scorpione";;
"Lib") _moon_done="Bilancia";;
"Leo") _moon_done="Leone";;
"Vir") _moon_done="Vergine";;
esac
case $_dayw in
"Sun") _dayw_done="Solis";;
"Mon") _dayw_done="Lunae";;
"Tue") _dayw_done="Martis";;
"Wed") _dayw_done="Mercurii";;
"Thu") _dayw_done="Jovis";;
"Fri") _dayw_done="Veneris";;
"Sat") _dayw_done="Saturnis";;
esac
# Main function
#echo "☉︎ in ${_sun_pos}° ${_sun_done} : ☽︎ in ${_moon_pos}° ${_moon_done} : dies ${_dayw_done} : Anno Vviii a.n."
echo "
☉︎ in ${_sun_pos}° ${_sun_done}
☽︎ in ${_moon_pos}° ${_moon_done}
Dies ${_dayw_done}
Anno V:viii a.n.
93, 93/93 A.·.A.·.
"