Skip to content

Instantly share code, notes, and snippets.

Created January 21, 2016 08:50
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 anonymous/a5410219b338cd6d981b to your computer and use it in GitHub Desktop.
Save anonymous/a5410219b338cd6d981b to your computer and use it in GitHub Desktop.
powerline/segments/dropbox.py
#!/usr/bin/env python
from powerline.lib.shell import run_cmd
## Requires dropbox-cli and FontAwesome
def status(pl):
status = run_cmd(pl, ['dropbox-cli', 'status']).rstrip()
if status == 'Up to date':
return [
{
'contents': '\uf16b',
'highlight_groups': ['dropbox'],
'draw_inner_divider': True
}
]
else:
return [
{
'contents': '\uf021',
'highlight_groups': ['dropbox:syncing'],
'draw_inner_divider': True
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment