willwhitney / live-earth-desktop

A tool that continually downloads the latest GOES-East image of the Earth.
46 stars 8 forks source link

Unsure why it's unresponsive sometimes #5

Closed jaanli closed 5 years ago

jaanli commented 5 years ago

Love this script, thank you Will. Sometimes if I close the lid on my mac or try to shut down the python script will be unresponsive. Not sure what's causing this, any ideas? I could check to see if there's a way to catch a timeout exception.

willwhitney commented 5 years ago

Interesting, I haven't run into that. Is there an error message or anything that could help debug?

Are you running the current version? A past version had a pretty bad try/except that might eat problems or interrupts.

Are you running it with launchctl? I've actually been using recently BitBar so that I get a timestamp in my Mac menu bar (and a GUI way start or stop it).

jaanli commented 5 years ago

Hmm good idea, not sure where to look for the error message.

Yup using launchctl right now and running the latest version.

How are you using it with BitBar?

(Just installed it, it looks amazing thanks for the pointer :)

willwhitney commented 5 years ago

For BitBar I have a file named goes-east.10m.sh in my BitBar plugin directory (for me ~/.bitbar, but you can change it).

The file just has these contents:

#!/bin/bash
/Users/willwhitney/anaconda3/bin/python /Users/willwhitney/code/live-earth-desktop/goes-east.py

Basically you just put any file with a hashbang in that folder, and give it a name that includes how often to run the script (e.g. script.10s.py would run every 10 seconds). Here are their docs for all the stuff you can do: https://github.com/matryer/bitbar#writing-plugins

This gives me the little globe and timestamp in my menu bar:

image
willwhitney commented 5 years ago

Also I think if you look in goes-east.plist it says where stdout/stderr are redirected when you use launchctl.

jaanli commented 5 years ago

Awesome, that worked–thanks so much! 🙏 Love this BitBar thing.