diff --git a/bumblebee/modules/time.py b/bumblebee/modules/time.py index 0fec842..1ae6e44 100644 --- a/bumblebee/modules/time.py +++ b/bumblebee/modules/time.py @@ -3,9 +3,10 @@ import bumblebee.module class Module(bumblebee.module.Module): def __init__(self, args): + self._fmt = args[0] if args else "%x %X" super(Module, self).__init__(args) def data(self): - return datetime.datetime.now().strftime("%x %X") + return datetime.datetime.now().strftime(self._fmt) # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 diff --git a/i3bumblebee b/i3bumblebee index 0fdab02..35f03b5 100755 --- a/i3bumblebee +++ b/i3bumblebee @@ -27,8 +27,8 @@ def main(): for m in args.modules: # TODO: how to cleanly handle errors here? # (useful error messages) - module_name = m if not ":" in m else m.split(":")[0] - module_args = None if not ":" in m else m.split(":")[1:] + module_name = m if not "::" in m else m.split("::")[0] + module_args = None if not "::" in m else m.split("::")[1:] module = importlib.import_module("bumblebee.modules.{}".format(module_name)) modules.append(getattr(module, "Module")(module_args))