bumblebee-status/core/config.py
Tobias Witek 8622673114 [core] Re-enable preliminary module loading (stubbed)
Add logic for parsing commandline options, and a preliminary stub for
loading modules.

Note: The idea is that core.module.load() will return a valid, but
empty, module that displays an error, if the module cannot be loaded
2020-01-19 15:36:52 +01:00

15 lines
862 B
Python

import argparse
MODULE_HELP = "Specify a space-separated list of modules to load. The order of the list determines their order in the i3bar (from left to right). Use <module>:<alias> to provide an alias in case you want to load the same module multiple times, but specify different parameters."
class Config(object):
def __init__(self, args):
parser = argparse.ArgumentParser(description='bumblebee-status is a modular, theme-able status line generator for the i3 window manager. https://github.com/tobi-wan-kenobi/bumblebee-status/wiki')
parser.add_argument("-m", "--modules", nargs="+", action='append', default=[],
help=MODULE_HELP)
self._args = parser.parse_args(args)
def modules(self):
return [item for sub in self._args.modules for item in sub]
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4