Created
November 6, 2013 19:11
-
-
Save pronto/7342275 to your computer and use it in GitHub Desktop.
Space API for tmux output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import simplejson | |
import urllib2 | |
url="http://www.uasstatus.com/spaceapi.json" | |
out=urllib2.urlopen(url).read() | |
json=simplejson.loads(out) | |
if json['open']== True: | |
line= "#[fg=green,bold]|{0}|" | |
else: | |
line= "#[fg=red]|{0}|" | |
print line | |
#put this file somewhere; | |
#change for your space; list of spaces use space api is http://spaceapi.net/directory | |
#then in .tmux.conf | |
#set -g status-right "#[fg=red]#( ~/path.to.script.py)" | |
#if tmux is already loaded you can do a ctrl-modkey : to bring up the prompot and do source-file ~/.tmux.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment