In iTerm2, in the menu bar go to Scripts > Manage > New Python Script
Select Basic. Select Long-Running Daemon
Give the script a decent name (I chose auto_dark_mode.py)
Save and open the script in your editor of choice.
| from matplotlib import animation | |
| import matplotlib.pyplot as plt | |
| import gym | |
| """ | |
| Ensure you have imagemagick installed with | |
| sudo apt-get install imagemagick | |
| Open file in CLI with: | |
| xgd-open <filelname> |