Skip to content
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

Fix the background agent for the weather script #203

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

palkx
Copy link
Contributor

@palkx palkx commented Apr 20, 2023

Motivation for the change

The weather daemon isn't spawned when you start Tmux.
In the condition to launch the sleep_weather.sh we have a check for a tmux session before starting while loop.
But Tmux on startup waiting for this script to finish before proceeding and creating the session.
When the session is spawned we will have weather data now because it'll be fetched by the script before the while loop is reached. After initial weather retrieval, it won't be updated anymore.

I've changed this behavior and the weather script will be triggered by the Tmux status line. It's recording the time of the last execution. If the delta between the current time and of the time of the last execution is bigger than the 1200s (default value) it won't do anything. With this change, we'll not be needed a background agent at all.

Also, sleep_weather.sh didn't honor theme options on the first execution (the first weather retrieval is happening without passing those options to the script). So, this PR will fix #181

Change tested on the MacOS aarch64.

@palkx
Copy link
Contributor Author

palkx commented Apr 24, 2023

@ethancedwards8 Would you mind to review this PR as well? Thank you.
Let me know if I need to add/change something within this PR.

@ethancedwards8 ethancedwards8 merged commit 6de4866 into dracula:master Apr 24, 2023
1 check passed
@palkx palkx deleted the feature/fix-weather-script branch April 24, 2023 13:14
@raja
Copy link

raja commented May 30, 2023

@ethancedwards8 can we get a new release with this change.

@ethancedwards8
Copy link
Member

Yes. Thanks for reminding me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Weather unit keeps resetting to Farenheit
3 participants