Skip to content

Instantly share code, notes, and snippets.

@marcellmars
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcellmars/9717475 to your computer and use it in GitHub Desktop.
Save marcellmars/9717475 to your computer and use it in GitHub Desktop.
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