#!/bin/sh

# Script:       Optional Date-Time-Location Prompt
#                  with All Command Line Options,
#                    Most of Them Set Weirdly
#                         for Eryss 0.1          
#
# by Apollia - http://apollia.com/
#
# http://eryss.com/
#
#
#------------------------------------------------------------------------------
#
# Displays an input box asking the user for a date and/or time and/or location,
# all of which are optional.
#
# The user's input is passed to the Eryss 0.1 PHP console script.
#
# This shows all the command line options that are available, so you can 
# easily make a copy and change it to have the settings you like without
# having to edit the Eryss 0.1 main script.
#
#------------------------------------------------------------------------------
#
# Under the GNU Affero General Public License v3.0.
#
#
# Copyright (C) 2013-2019  Apollia
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as published
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#
# Contact info:     http://astroblahhh.com/contact-apollia.shtml
#
# ----



THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"


Xdialog --title "Date/Time/Location for Eryss Astrology Software" \
        --inputbox "Please input a date and/or time and/or location.
All are optional.

The location must be at the end of the line, and in this format:

79:59W 40:26N

Then, click OK, or type Tab then Enter on your keyboard.

Leave the input box blank for astrological positions for the present moment.

Will use no prefs file. Using settings inside this prompt script." 0 0 2> /tmp/Apollias-Astrological-Data-Input-Prompt.tmp.$$


retval=$?
input=`cat /tmp/Apollias-Astrological-Data-Input-Prompt.tmp.$$`
rm -f /tmp/Apollias-Astrological-Data-Input-Prompt.tmp.$$


case $retval in
  0)

	if [ -z $input ]
	then
		input=now
	fi
    
    echo "Input string is '$input'"

sh "Open terminal window which waits for Enter key press instead of instantly closing at end of script" \
"$THIS_SCRIPT_DIR/Eryss 0.1.phpb" \
"$input" \
"HTML_Page_Header=Custom HTML Page Header" \
"HTML_Page_Title_Prefix=Custom HTML Page Title Prefix" \
"Custom_HTML_Comment=Custom comment" \
Should_Display_When_Calculated_Date=true \
Should_Display_Julian_Day=false \
Should_Display_Original_Chart_Data_Line=false \
Default_Calculation_Type=Tropical \
Should_Output_in_Zodiacal_Order=true \
Should_Output_in_Arbitrary_Order=true \
Should_Output_in_Zodiacal_Order_First=false \
Default_Search_Engine=Bing \
Should_Output_HTML_Page=true \
Should_Display_HTML_Page=true \
Should_Display_Unicode_Astro_Glyphs_in_HTML_Page=true \
Should_Display_Astro_Names_in_HTML_Page=true \
Should_Open_Chart_in_Astrolog_540=false \
Should_Show_Long_Sign_Names=false \
Should_Round_Off_Arc_Seconds=false \
Should_Display_Longitude_Speed=false \
Should_Display_House_Data=true \
Should_Display_Compact_HTML_Table_of_Houses=true \
Should_Display_HTML_Page_Footer=false \
Should_Display_Main_Celestial_Objects=true \
Should_Display_Ceres_Chiron_Pholus_Pallas_Juno_Vesta=false \
Should_Display_All_Dwarf_Planets_Besides_Pluto_and_Ceres=false \
Should_Display_360_Degree_Absolute_Zodiacal_Position_of_Objects=false \
Should_Display_360_Degree_Absolute_Zodiacal_Position_of_House_Cusps=false \
Web_Browser_Shell_Command=dillo \
"Default_Label_for_Search_Engine_Link=Search" \
"Default_Label_for_JPL_Link=JPL" \
"Swiss_Ephemeris_Folder=/root/sweph/" \
Longitude=79:59W \
Latitude=40:26N \
Should_Use_All_Available_Ephemerides_for_Asteroids_Etc=false \
"Default_House_Method=Koch" \
"specific_asteroids_etc=Doga, Upupa, Linux" \
"excluded_asteroids_etc=Blaha" \
"excluded_no_offset_celestial_objects=SE_SUN" \
"no_offset_celestial_objects=SE_VENUS" \
#"Astrolog_540_Folder=/mnt/truecrypt1/Observatory/ast54unx/" \
#"Path_to_CSS=
    ;;
    
  1)
    echo "Cancel pressed.";;
  255)
    echo "Box closed.";;
esac