Commit graph

79 commits

Author SHA1 Message Date
tobi-wan-kenobi
14f19c897a [modules/pulsectl] add default device selection
re-enable functionality to add a popup that allows the user to select
the default source/sink.

fixes #965
2023-05-11 08:45:03 +02:00
tobi-wan-kenobi
6a93238bda [core] log exceptions
to enable error investigation, log exceptions.

see #940
2022-11-27 09:46:55 +01:00
tobi-wan-kenobi
07e2364f78 [main] fix i3 protocol buf on error messages ("could not parse JSON")
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
2022-11-26 10:11:51 +01:00
tobi-wan-kenobi
f4bd0fba0b [core] fix concurrency issues
* 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
2022-09-09 20:58:59 +02:00
tobi-wan-kenobi
28601cf2b7 Revert "Merge branch '917-event-based-pulseaudio'"
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.
2022-09-09 08:39:05 +02:00
tobi-wan-kenobi
ee9885a601 [core] fix concurrency issues
* 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
2022-09-04 16:22:29 +02:00
tobi-wan-kenobi
9f89e3a657 [core] make bumblebee more reactive
- set default delay to 0
- split input reading into 2 threads
- get rid of polling
2021-03-13 14:10:30 +01:00
tobi-wan-kenobi
c5f13746b3
Merge pull request #730 from donfranio/fix-for-missing-python2
update python name in shebang to respect PEP-0394
2020-10-26 09:03:51 +01:00
Frank Scherrer
5e96b63c60
update python name in shebang to respect PEP-0394 2020-10-26 08:28:55 +01:00
tobi-wan-kenobi
1759c33cf3 [bumblebee] make input delay configurable
make the delay before updating the bar after an input event
configurable as engine.input_delay.

see #702
2020-09-16 09:13:48 +02:00
tobi-wan-kenobi
806b97895e [bumblebee] add small sleep before update
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.
2020-09-16 09:09:49 +02:00
Tobias Witek
e42f09b27e [bumblebee] Make update lock on input non-blocking
for consistent lock behaviour, make the input loop lock non-blocking.

see #702
2020-09-13 11:21:39 +02:00
tobi-wan-kenobi
905f71fa52 [core] fix broken "sparse" updates
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
2020-08-28 17:14:05 +02:00
Joshua Barrass
c77f3aa3bc
Force update using USR1 signal 2020-08-11 00:45:13 +01:00
Tobias Witek
582c828deb [core] guard against concurrent updates
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
2020-06-23 20:20:36 +02:00
Tobias Witek
34dadadf90 [core] re-enable minimize of widgets
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
2020-06-23 15:51:14 +02:00
tobi-wan-kenobi
747e67e1be [bumblebee-status] add python 2.x warning
explicitly report that Python 2.x is not supported

see #645
2020-06-04 20:30:48 +02:00
tobi-wan-kenobi
a13898cbae [bumblebee-status] fix double "version" line 2020-05-30 17:20:13 +02:00
tobi-wan-kenobi
3bb2fb8247 [core/module] add missing registration of input events via CLI
see #628
2020-05-15 19:59:13 +02:00
tobi-wan-kenobi
bc382e67d3 [general] black code some more 2020-05-14 20:36:01 +02:00
tobi-wan-kenobi
320827d577 [core] restructure to allow PIP packaging
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...
2020-05-09 21:22:00 +02:00
tobi-wan-kenobi
7aa201dd30 [all] re-apply black 2020-05-04 20:12:02 +02:00
tobi-wan-kenobi
6fc8042899 [main] always show errors in status line
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.
2020-05-03 11:32:38 +02:00
tobi-wan-kenobi
30c1f712a6 [formatting] reformat using "black -t py34"
getting rid of thinking about consistent formatting...
2020-05-03 11:15:52 +02:00
tobi-wan-kenobi
ba24ba13db [core/input] add default workspace wrap bindings (mouse wheel up/down) 2020-05-02 13:54:45 +02:00
tobi-wan-kenobi
af80f4c620 [ctl] re-add bumblebee-ctl
add a utility that allows the user to programmatically trigger mouse
events for i3
2020-05-02 09:41:41 +02:00
tobi-wan-kenobi
4daae88a7c [core] Add right-to-left output 2020-05-01 15:34:29 +02:00
tobi-wan-kenobi
595778f7c3 [core/config] enable logging into a log file
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
2020-05-01 09:42:26 +02:00
tobi-wan-kenobi
32444ed49f [modules/cmus] Update to latest API 2020-04-28 20:25:28 +02:00
tobi-wan-kenobi
28bdf4355b [core] Add theme to modules 2020-04-26 16:40:48 +02:00
tobi-wan-kenobi
cfa1a5c896 [modules/cpu2] Update to latest API 2020-04-26 10:34:25 +02:00
tobi-wan-kenobi
ec2b2a8a4b [modules/smartstatus] Updated to latest API 2020-04-26 10:07:17 +02:00
tobi-wan-kenobi
806d08ad4c [modules/title] Update to latest API 2020-04-25 10:40:11 +02:00
tobi-wan-kenobi
771eaf331e [modules/shortcut] update to latest API 2020-04-21 20:37:54 +02:00
tobi-wan-kenobi
bfc3832428 [modules/yubikey] Update to new API 2020-04-13 09:40:24 +02:00
tobi-wan-kenobi
9e32cdef5d [core] Rename events for more clarity 2020-04-12 20:11:02 +02:00
tobi-wan-kenobi
f965c6b664 [main] Update status bar via event 2020-04-12 14:44:34 +02:00
tobi-wan-kenobi
f262080e78 [modules/shell] Small refactoring
Use threads a bit differently do make do with fewer helper functions.
2020-03-30 21:18:28 +02:00
tobi-wan-kenobi
d5820160dc [modules/sensors2] Fix runtime errors 2020-03-28 13:44:45 +01:00
Tobias Witek
a1aec8fff6 [core/module] Add error widgets if a module throws
Module should have to care less about thrown exceptions.
2020-03-01 14:08:16 +01:00
Tobias Witek
a4904d998f [core] Use core.event to decouple main and output
Make output act on events, not on concrete calls.
2020-02-16 14:30:45 +01:00
Tobias Witek
f05098a120 [main] Add error widget for 'all' errors
One exception: Wrong arguments aren't handled, because argparse doesn't
throw in this circumstance.
2020-02-16 13:50:15 +01:00
Tobias Witek
5d971267db [core/theme] Add preparatory work for themes
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).
2020-02-09 13:46:56 +01:00
Tobias Witek
4e2a645bd3 [core/input] Separate module/widget update and retrieval
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.
2020-02-09 13:25:34 +01:00
Tobias Witek
5810a12944 [core/output] Start implementation of a partial update
Add a "patch()" method that eventually will only update affected
modules.
2020-02-08 14:22:43 +01:00
Tobias Witek
468e30ce66 [main] Add input thread logic and logging
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)
2020-02-08 13:56:52 +01:00
Tobias Witek
3a531c359f [core/module] Add config to module
Add access for all modules to the commandline parameters (called
"config" in bumblebee-status)
2020-02-03 21:30:06 +01:00
Tobias Witek
445c5a65f1 [core/output] Move widget/module handling inside output
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.
2020-02-02 14:18:13 +01:00
Tobias Witek
66537fbe05 [core/output] Rewrite to hide sys.stout
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.
2020-02-01 21:37:38 +01:00
Tobias Witek
a17cd4759c [core/output] Implement simple wait
To pace the output lines, implement a simple wait() call for the i3
output.
2020-01-26 13:31:20 +01:00