Errors during startup currently cause bumblebee-status to mistakenly
output the first line of output (the "version" line) of the i3 protocol
twice, causing an error message that says "could not parse JSON")
see #940
* initialize first line of output earlier (before modules are
initialized, so that module/thread output cannot interfere)
* make sure that update and draw are protected against concurrent access
This reverts commit 72a888748e, reversing
changes made to d57ef9364a.
This merge causes really high CPU load if using both pasink and
pasource, because those two modules trigger each other, and there's not
a terrible lot I can do about that, unfortunately.
* initialize first line of output earlier (before modules are
initialized, so that module/thread output cannot interfere)
* make sure that update and draw are protected against concurrent access
in some situations/modules (spotify, playerctl, etc.), it is possible
that a state change (e.g. play/pause) takes a small time to actually
propagate into the whole system (e.g. until the next "update" retrieves
the correct value).
To alleviate that, add a very small delay to the update.
c77f3aa accidentially broke "sparse" updates (i.e. updates that do not
trigger during each update interval).
Introduce a new update parameter, "force", to model the use case "update
everything on SIGUSR1".
fixes#692
when a "regular" update (once per interval) and a input-triggered update
(e.g. mouse click on a widget) collide, this can cause the theme colors
to be interleaved wrongly.
fixes#661
by default, allow toggling the minimized state of a widget via the
middle mouse and draw a single unicode char instead of the actual
widget, maintaining all states.
fixes#661
OK - so I have to admit I *hate* the fact that PIP seems to require a
subdirectory named like the library.
But since the PIP package is something really nifty to have (thanks to
@tony again!!!), I updated the codebase to hopefully conform with what
PIP expects. Testruns so far look promising...
try to completely get rid of the occasional ("exited with status N") in
the status bar by catching exceptions and showing a very very minimal
error message.
Re-enable the -f | --logfile parameter, but still default to logging to
stderr.
Also, add a "debug" module that is automatically displayed if a bar is
run in debug mode (thanks to @bbernhard for the excellent suggestion)
fixes#614
Add two new parameters: theme and iconset
Add a placeholder class core.theme.Theme, an instance of which is passed
in to the i3 output object (which is the only object that should ever
have need of the theme, hopefully).
To make it easier to update individual modules, separate the call to
update() and the call to actually drawing the status.
Additionally, this avoids the "side effect" of updating when drawing the
status line.
To the main application, add an input thread that "simply" reads
sys.stdin events and transmits them via core.input.
Additionally, set up some initial logging (yeah, for threading, this is
needed immediately)
The core.output module now manages the list of modules and retrieves the
widgets inside draw() itself. That way, details of drawing/updating
widgets are not visible from the outside anymore.
Add generic "draw()" method that redirects internally to the actual
calls. These can now produce JSON, which is nicer because:
1. Easier to use during testing
2. More flexible
3. Centralizes printing (somewhat)
Still, the "suffix" concept isn't really nice, but so far, I have no
better approach.