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

Streamline fettching of locator grid #112

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Conversation

corvus-ch
Copy link
Contributor

Getting GPS locator in Conky working on my machine, I identified some easy improvements.

  • Have only one script to update the data in gridinfo.txt
  • Error handling prevents failure if gpsd is not running or is not connected to a GPS device
  • Use Conky's cat instead of execi to read the grid info

This should simplify future maintenance and improves runtime stability.

@km4ack
Copy link
Owner

km4ack commented Nov 5, 2024

rebase this against the dev branch please.

* Directly write to cache file
* Ignore errors while communicating with gpds
* Calculate gird only on eactive GPS fix
* Remove unused imports
* Reduce grid presicion
@corvus-ch corvus-ch changed the base branch from master to dev November 5, 2024 14:26
@corvus-ch
Copy link
Contributor Author

Done.

@km4ack
Copy link
Owner

km4ack commented Nov 10, 2024

By removing the execi 60 in conky, doesn't this mean that Conky will only read the file once or am I missing something? We typically want the GPS coordinates to be updated. Historically this has been every 60 seconds.

@corvus-ch
Copy link
Contributor Author

corvus-ch commented Nov 10, 2024

By removing the execi 60 in conky, doesn't this mean that Conky will only read the file once or am I missing something? We typically want the GPS coordinates to be updated. Historically this has been every 60 seconds.

The content of ~/.conkyrc is evaluated once every update_interval seconds, which is set to 0.5. Everything except the commands with their own interval (for example execi), get evaluated at that interval. Reading the file every 0.5 seconds is OK because the inbuilt cat function reads the file within the Conky process itself. This is cheap. No shell gets spawned as it is the case with exec and execi which is actually an expensive operation in itself and only makes sense when calling an even more expensive script.

With my change, the only thing determining the position refresh rate, is the cron job executing ~/data/conky/grid. That is, unless we would want to go below update_interval of Conky which is unreasonable.

@km4ack
Copy link
Owner

km4ack commented Nov 10, 2024

Thanks for the explanation. I'll get this pulled into the next update

@corvus-ch
Copy link
Contributor Author

Is there anything I can help with to get this merged?

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

Successfully merging this pull request may close these issues.

2 participants