[themes] Make individual items theme-able (a bit)

Individual items in the bar can now be configured with a prefix and a
suffix. It works like this:

* If there is a specific module configuration in the theme
  configuration, use that (i.e. { "<modulename>": { "prefix: " a " } })
* Otherwise, if there is a configuration in the "default" section of the
  theme, use that
* Otherwise, if the module object itself has a method called like the
  required attribute (prefix, suffix), use that
* Otherwise, leave prefix/suffix empty ("")
This commit is contained in:
Tobias Witek 2016-10-31 07:18:57 +01:00
parent e895400589
commit 3ca53dd0fa
7 changed files with 51 additions and 12 deletions

View file

@ -4,7 +4,7 @@ import sys
import time
import argparse
import importlib
import bumblebee.themes
import bumblebee.theme
import bumblebee.outputs.i3
def print_module_list():
@ -24,7 +24,7 @@ def main():
sys.exit(0)
modules = []
theme = bumblebee.themes.Theme(args.theme)
theme = bumblebee.theme.Theme(args.theme) if args.theme else bumblebee.theme.Theme()
for m in args.modules:
# TODO: how to cleanly handle errors here?
# (useful error messages)