[themes] Configure presence of default i3bar separators

For each theme & module, it is now possible to configure whether the
default i3bar separators should be drawn or not.
This commit is contained in:
Tobias Witek 2016-10-31 07:39:26 +01:00
parent 97273b5a41
commit 60f63f3269
3 changed files with 14 additions and 7 deletions

View file

@ -10,11 +10,15 @@ class i3bar(bumblebee.output.Output):
def add(self, obj): def add(self, obj):
theme = obj.theme() theme = obj.theme()
self._data.append({
"full_text": "%s%s%s" % (theme.prefix(obj), obj.data(), theme.suffix(obj)), data = {
"separator": False, "full_text": "%s%s%s" % (theme.prefix(obj), obj.data(), theme.suffix(obj))
"separator_block_width": 0, }
}) if theme.default_separators(obj) == False:
data["separator"] = False
data["separator_block_width"] = 0
self._data.append(data)
def get(self): def get(self):
data = json.dumps(self._data) data = json.dumps(self._data)

View file

@ -25,6 +25,9 @@ class Theme:
return value return value
def default_separators(self, obj):
return self._gettheme(obj, "default_separators")
def prefix(self, obj): def prefix(self, obj):
return self._gettheme(obj, "prefix") return self._gettheme(obj, "prefix")

View file

@ -7,10 +7,10 @@
"prefix": "bat ", "prefix": "bat ",
"states": { "states": {
"charging": { "charging": {
"suffix": "+" "suffix": "+ "
}, },
"discharging": { "discharging": {
"suffix": "-" "suffix": "- "
} }
} }
}, },