diff --git a/core/config.py b/core/config.py index 4d6c1a3..85c6190 100644 --- a/core/config.py +++ b/core/config.py @@ -18,8 +18,10 @@ class Config(util.store.Store): parser.add_argument('-t', '--theme', default='default', help=THEME_HELP) parser.add_argument('-i', '--iconset', default='auto', help='Specify the name of an iconset to use (overrides theme default)') - parser.add_argument("-a", "--autohide", nargs="+", default=[], - help="Specify a list of modules to hide when not in warning/error state") + parser.add_argument('-a', '--autohide', nargs='+', default=[], + help='Specify a list of modules to hide when not in warning/error state') + parser.add_argument('--debug', action='store_true', + help='Add debug fields to i3 output') self._args = parser.parse_args(args) parameters = [ item for sub in self._args.parameters for item in sub ] @@ -33,6 +35,9 @@ class Config(util.store.Store): def interval(self): return float(self.get('interval', 1)) + def debug(self): + return self._args.debug + def theme(self): return self._args.theme diff --git a/core/output.py b/core/output.py index 927085b..6e84cc1 100644 --- a/core/output.py +++ b/core/output.py @@ -50,6 +50,7 @@ class i3(object): return '{}{}{}'.format(padding, full_text, padding) def __decorate(self, module, widget, full_text): + if full_text is None: return None return '{}{}{}'.format( self.__pad(module, widget, self._theme.prefix(widget)), full_text, @@ -88,6 +89,10 @@ class i3(object): 'background': self._theme.bg(widget), 'min_width': self.__decorate(module, widget, widget.get('theme.minwidth')), }) + if (self._config.debug()): + attr.update({ + '__state': ", ".join(module.state(widget)) + }) return [attr] def widgets(self, module): diff --git a/modules/contrib/dunst.py b/modules/contrib/dunst.py index 79df80b..97209cb 100644 --- a/modules/contrib/dunst.py +++ b/modules/contrib/dunst.py @@ -13,7 +13,7 @@ class Module(core.module.Module): super().__init__(config, core.widget.Widget('')) self._paused = False # Make sure that dunst is currently not paused - util.cli.execute('killall -SIGUSR2 dunst', ignore_errors=True) + util.cli.execute('killall -s SIGUSR2 dunst', ignore_errors=True) core.input.register(self, button=core.input.LEFT_MOUSE, cmd=self.toggle_status ) @@ -23,9 +23,9 @@ class Module(core.module.Module): try: if self._paused: - util.cli.execute('killall -SIGUSR1 dunst') + util.cli.execute('killall -s SIGUSR1 dunst') else: - util.cli.execute('killall -SIGUSR2 dunst') + util.cli.execute('killall -s SIGUSR2 dunst') except: self._paused = not self._paused # toggling failed