Skip to content

Instantly share code, notes, and snippets.

@marcellmars
Last active Aug 29, 2015
Embed
What would you like to do?
redshiftme - runs gtk-redshift with coordinates by just running: `redshiftme city`
#!/usr/bin/env python
#use: redshiftme city
import geopy, sys, subprocess
coords = "44.820556:20.462222"
try:
coords = str(geopy.GoogleV3().geocode('{}'.format(sys.argv[1]))[1]).replace(', ', ':').replace('(','').replace(')','')
except:
pass
subprocess.call(["redshift-gtk", "-l", coords])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment