-
Notifications
You must be signed in to change notification settings - Fork 0
Fix weather geolocation and make word of day fully offline #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
da20cb8
40c72f6
f15a0e5
f14e2c8
e988ed1
7ab96dc
9e44650
ada7e51
fd2af2d
e6faffc
954558b
9a3b70d
484601f
18ebb03
4d61912
0708c13
b00d902
0861841
15d9ad4
0643f38
c66c9b5
b30bc30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -279,12 +279,41 @@ brew install figlet | |||||
| ### Command Line Options | ||||||
|
|
||||||
| ```bash | ||||||
| ./goodmorning.sh # Run with default settings | ||||||
| ./goodmorning.sh --noisy # Enable text-to-speech greeting | ||||||
| ./goodmorning.sh --doctor # Run system diagnostics and validation | ||||||
| ./goodmorning.sh --help # Show help message | ||||||
| ./goodmorning.sh # Run with default settings | ||||||
| ./goodmorning.sh --noisy # Enable text-to-speech greeting | ||||||
| ./goodmorning.sh --doctor # Run system diagnostics and validation | ||||||
| ./goodmorning.sh --section cat # Run a single section (skips preflight/updates) | ||||||
| ./goodmorning.sh --help # Show help message | ||||||
| ``` | ||||||
|
|
||||||
| **Running Individual Sections:** | ||||||
| You can run a single section without preflight checks or background updates: | ||||||
| ```bash | ||||||
| ./goodmorning.sh --section weather | ||||||
| ./goodmorning.sh --section word | ||||||
| ./goodmorning.sh --section github-prs | ||||||
| ``` | ||||||
|
|
||||||
| Available sections: | ||||||
| - `weather` - Current weather conditions | ||||||
| - `history` - Historical events for today | ||||||
| - `tech-versions` - Latest versions of tools and technologies | ||||||
| - `country` - Random country of the day | ||||||
| - `word` - Word of the day with definition | ||||||
| - `wikipedia` - Wikipedia featured article | ||||||
| - `apod` - NASA Astronomy Picture of the Day | ||||||
| - `cat` - Random cat picture | ||||||
| - `calendar` - Today's calendar events | ||||||
| - `reminders` - Upcoming reminders | ||||||
| - `github` - GitHub notifications | ||||||
| - `github-prs` - GitHub pull requests requiring review | ||||||
| - `github-issues` - GitHub issues assigned to you | ||||||
| - `alias-suggestions` - Shell alias suggestions | ||||||
| - `system-info` - System information and updates | ||||||
| - `learning` - Daily learning resource | ||||||
| - `sanity` - Sanity maintenance tips | ||||||
| - `tips` - AI-powered learning tips | ||||||
|
|
||||||
| **Text-to-Speech:** | ||||||
| By default, the spoken "Good morning" greeting is disabled. Enable it with: | ||||||
| - Runtime flag: `./goodmorning.sh --noisy` | ||||||
|
|
@@ -315,6 +344,7 @@ Configuration is managed through environment variables. The setup script handles | |||||
| | `GOODMORNING_LOGS_DIR` | Directory for log files | `$GOODMORNING_CONFIG_DIR/logs` | No | | ||||||
| | `GOODMORNING_OUTPUT_HISTORY_DIR` | Directory for output history | `$GOODMORNING_CONFIG_DIR/output_history` | No | | ||||||
| | `GOODMORNING_SHOW_WEATHER` | Show weather section | `true` | No | | ||||||
| | `GOODMORNING_WEATHER_LOCATION` | City for weather (e.g., San_Francisco, London) | (none) | **Yes** | | ||||||
|
||||||
| | `GOODMORNING_WEATHER_LOCATION` | City for weather (e.g., San_Francisco, London) | (none) | **Yes** | | |
| | `GOODMORNING_WEATHER_LOCATION` | City for weather (e.g., San_Francisco, London) | (none) | If weather enabled (`GOODMORNING_SHOW_WEATHER=true`) | |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -33,11 +33,28 @@ show_banner() { | |||||
|
|
||||||
| show_weather() { | ||||||
| print_section "🌤️ Weather:" "yellow" | ||||||
| local weather=$(fetch_with_spinner "Fetching weather..." curl -s --max-time 10 "wttr.in/?format=3") | ||||||
| if [ -n "$weather" ]; then | ||||||
| local location="${GOODMORNING_WEATHER_LOCATION:-}" | ||||||
|
|
||||||
| if [ -z "$location" ]; then | ||||||
| show_setup_message "Set GOODMORNING_WEATHER_LOCATION to your city (e.g., San_Francisco)" | ||||||
| show_new_line | ||||||
| return 0 | ||||||
| fi | ||||||
|
|
||||||
|
bgreg marked this conversation as resolved.
|
||||||
| # Validate location to avoid unsafe characters in the URL | ||||||
| if ! [[ "$location" =~ ^[A-Za-z0-9_-]+$ ]]; then | ||||||
|
||||||
| if ! [[ "$location" =~ ^[A-Za-z0-9_-]+$ ]]; then | |
| if ! [[ "$location" =~ ^[a-z0-9_-]+$ ]]; then |
Uh oh!
There was an error while loading. Please reload this page.