bumblebee-status/bumblebee/outputs/i3.py
Tobias Witek 4ad41a8ee0 [themes] Add themeing framework
Add - again a very simplistic - method for themeing the output.
Essentially, the plan is to have JSON-formatted configuration files in
bumblebee/themes/ and have a separate class for querying the config
whenever the output needs to know about semantic formatting/coloring.

Note that the theme object is stored on a per-module basis. Right now,
that doesn't have any effect (except looking particularly wasteful), but
the idea is to be able to have different themes for different modules in
the future.
2016-10-30 17:56:04 +01:00

24 lines
498 B
Python

import json
import bumblebee.output
class i3bar(bumblebee.output.Output):
def __init__(self):
self._data = []
def start(self):
return json.dumps({ "version": 1 }) + "["
def add(self, obj):
self._data.append({
"full_text": obj.data()
})
def get(self):
data = json.dumps(self._data)
self._data = []
return data + ","
def stop(self):
return "]"
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4