Add neato BitBar plugins to the repo, since I'm basically writing my own anyway

This commit is contained in:
Danielle McLean 2017-09-07 12:59:26 +10:00
parent 49554fad86
commit 6d4334d189
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
7 changed files with 96 additions and 0 deletions

View file

@ -0,0 +1,29 @@
import base64
import inspect
import os.path as p
import sys
PATH = p.dirname(p.abspath(inspect.getfile(inspect.currentframe())))
def count(file, icon='default'):
project = ''
items = []
with open(p.expanduser(file)) as f:
for line in f:
if project.lower() == 'archive': break
line = line.strip()
if line.endswith(':'):
project = line[:-1]
elif line.startswith('- ') and '@done' not in line:
items.append('%s (%s)' % (line[2:], project))
if not items: return
with open(p.join(PATH, icon + '.png')) as img:
icon = base64.b64encode(img.read())
print("%d | templateImage='%s'" % (len(items), icon))
print('---')
print("%s | terminal=false bash=/usr/bin/open param1='%s'" % (file, p.expanduser(file)))
print('---')
for item in items: print(item)

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B