Commit graph

76 commits

Author SHA1 Message Date
tobi-wan-kenobi
b42323013d fix(config): make config file keys case sensitive
Since the configparser library by default parses keys case insensitive
(all lowercase), certain mappings, especially in the pulseaudio modules,
could fail ("internal" pulseaudio device names are matched against
entries in the configuration).

fixes #992
2023-09-15 15:06:57 +02:00
Pavle Portic
37b5646d65
Allow adjusting the font size of tk popups 2023-09-06 12:11:57 +02:00
tobi-wan-kenobi
2e1289f778 [core] fix importlib.util error
add explicit import of importlib.util

fixes #962
2023-04-11 12:42:55 +02:00
C H
61e38c6094 Added path for themes directory when installed via pipx 2023-03-25 15:27:42 -07:00
tobi-wan-kenobi
1c19250fe5 [core/output] fix broken output 2022-09-18 16:50:43 +02:00
tobi-wan-kenobi
21cbbe685d [modules/scroll] add preliminary version of scrolling module
add a scrolling module that can be used to scroll the whole bar to an
arbitrary number of widgets.

its parameter is "width", which determines the number of widgets to
display.

see #921
2022-09-11 13:12:51 +02: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
40041d6080 Revert "[core/output] rate-limit output (see #917)"
(did not fix the issue)

This reverts commit b90346424b.
2022-09-04 09:41:20 +02:00
tobi-wan-kenobi
b90346424b [core/output] rate-limit output (see #917)
according to research (Jakob Nielsen '93), roughly 0.1s is what is
required for the user to feel "instantaneous".

based on this, rate-limit updates to only once per ~0.03s (0.1 felt
really laggy for me, so let's be conservative)
2022-09-01 21:15:14 +02:00
Ishaan Bhimwal
a5fbc73c44 fix typo 2022-07-21 11:37:33 +05:30
tobi-wan-kenobi
326e2f9318 [core/theme] add support for XDG_DATA_DIRS
read theme information from
$XDG_DATA_DIRS/bumblebee-status/themes

see #821
2022-07-03 13:56:02 +02:00
tobi-wan-kenobi
7d33171749 [core/input] methods can be event callbacks
When registering an event (especially mouse events), if the parameter
is a valid method in the Module, execute that with the event as
parameter.

Add this in the core.spacer module as an example.

fixes #858
see #857
2022-03-04 09:35:43 +01:00
tobi-wan-kenobi
26e4bdd7eb [modules/progress] improved autohide functionality
Simplify the previous autohide functionality by adding a flag that lets
a module (e.g. progress) indicate that the current state should be
"revealed" (not auto-hidden).

This vastly simplifies the implementation.

see #835
2021-11-06 08:21:08 +01:00
tobi-wan-kenobi
5ad211f862 Revert "[contrib/progress] allow hiding of inactive state"
This reverts commit cbd989309d.
2021-11-06 08:17:18 +01:00
tobi-wan-kenobi
6a3e4761bf Revert "[core/output] fix logic error when using "autohide""
This reverts commit 74ecbb6ca8.
2021-11-06 08:17:11 +01:00
tobi-wan-kenobi
74ecbb6ca8 [core/output] fix logic error when using "autohide"
- when state is critical or warning -> *show* the module
- when state is mayhide -> *hide* the module

see #835
2021-11-05 19:11:45 +01:00
tobi-wan-kenobi
cbd989309d [contrib/progress] allow hiding of inactive state
Add a new "hide-able" state "mayhide" that can be utilized by modules
without warning state. This state indicates that the module *may* be
hidden by autohide, if the user configures it like this.

see #835
2021-11-05 14:00:34 +01:00
tobi-wan-kenobi
f0ab3ef03a [core/config] fix autohide parameter from configuration file
Need to parse the config parameter "autohide" into a list and actually
check whether the current module is in the list.

see #835
2021-11-05 13:57:05 +01:00
tobi-wan-kenobi
c96d119b0e [core/config] add autohide to configuration file
make it possible to configure a list of automatically hidden modules in
the configuration file (+ add documentation for it).

fixes #822
2021-10-07 15:39:29 +02:00
tobi-wan-kenobi
4b6b4b9052 [core] add custom minimizer capability
Add a new set of parameters to allow modules to be customly minimized.

It works like this: If a module has the parameter "minimize" set to a
true value, it will *not* use the built-in minimizer, and instead look
for "minimized" parameters (e.g. if date has the "format" parameter, it
would look for "minimized.format" when in minimized state). This allows
the user to have different parametrization for different states.

Also, using the "start-minimized" parameter allows for modules to start
minimized.

Note: This is hinging off the *module*, not the *widget* (the current,
hard-coded hiding is per-widget). This means that modules using this
method will only show a single widget - the first one - when in
minimized state. The module author has to account for that.

see #791
2021-05-24 12:56:02 +02:00
tobi-wan-kenobi
1e13798c95 [core/input] add pseudo-event "update" to selectively update modules
to trigger an update of a module (without actually triggering a mouse
interaction), use the special event "update":

bumblebee-ctl -m <module> -b update

see #784
2021-04-28 12:41:04 +02:00
tobi-wan-kenobi
fb6be007e5 [core/output] fix minimum width with padding
when calculating the minimum width of a widget, also take the padding
into consideration.

see #785
2021-04-27 17:17:28 +02:00
tobi-wan-kenobi
527d1706c2 [core/module] add fallback for module loading
Looks like some Python versions work with find_spec(), others with
spec_from_file_location(), so add find_spec() as fallback.

fixes #779
2021-04-02 03:30:09 +00: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
8d88b23947 [modules] add a module "keys" that shows whether a key is pressed
also, add backend functionality to hide individual widgets of a module.
2021-03-13 13:17:20 +01:00
tobi-wan-kenobi
7d0d1455c8 [core/module] Add fallback for user module loading
If importlib.machinery is not present, fall back to importlib.util to
load the module by its absolute name.

hopefully fixes #763
2021-03-09 19:12:59 +01:00
Michal Cieslicki
618ebbeccc Add parameter to specify a configuration file 2021-02-20 13:50:31 +01:00
tobi-wan-kenobi
a27c284869 [core/module] fix failing unit test
wrong error handling again
2021-01-17 15:29:44 +01:00
tobi-wan-kenobi
beca26c2bf [core/config] Allow modules to be hidden when in critical/error state
When a module is in critical state, the user can now hide the module
(e.g. if pulseaudio fails to load).

fixes #746
2021-01-17 15:21:40 +01:00
tobi-wan-kenobi
45c0a382c9 [core/module] fix load error when no user module exists 2021-01-17 15:17:14 +01:00
tobi-wan-kenobi
21ded8f640 [core] Allow module loading from user directory
If a module fails to load from both core and contrib, fall back to
loading by file name from "~/.config/bumblebee-status/modules/<name>.py"

fixes #757
2021-01-17 14:18:58 +01:00
tobi-wan-kenobi
7b1659a1b5 [core/theme] add /usr/share as theme directory
add a theme directory /usr/share/bumblebee-status/themes for system-wide
theme installation.

fixes #753
2020-12-20 10:23:06 +01:00
tobi-wan-kenobi
a94114dd94 [core/module] better error reporting for failed module loads
if a module fails to load, explicitly log errors for core and contrib in
the error log, but be a bit less verbose (and less confusing) in the
module error message itself.

fixes #747
2020-12-19 13:07:29 +01:00
tobi-wan-kenobi
fa66873582 [core/theme] add xresources support
add support for reading foreground and background, and colors, from
xresources.py

many thanks to @Aliuakbar for the addition!

fixes #731
2020-12-07 09:01:08 +01:00
w1kl4s
1a7ae9ecc6 Fix Python 3.9 compatibility
Replaced threading.Thread.isAlive() with threading.Thread.is_alive()
2020-10-14 18:07:29 +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
tobi-wan-kenobi
df29627983 [core/doc] add autogenerated warning to modules.rst 2020-07-18 08:14:23 +02:00
tobi-wan-kenobi
72045b2318 [core/config] make configurable module list work
configparser doesn't seem to have direct array support,
so use format.aslist() to get a list of modules

fixes #678
2020-07-09 07:04:45 +02:00
tobi-wan-kenobi
a9f50f1b51 [core/config] add "core" config section
move theme and modules into a "core" config section
2020-07-09 07:04:22 +02:00
tobi-wan-kenobi
057f894d52 [core/config] change preferred theme source
now, it works like this:

- if present, use what's on the CLI
- if not, use what's present in the config
- fallback is "default"

see #679
2020-07-09 06:56:43 +02:00
ColdFire
aac2316d74
Updating config parser 2020-07-06 14:20:41 +05:30
tobi-wan-kenobi
227a23fdb5 [core/theme] fix mergeing of iconsets
iconsets should only overwrite parameters that are *not* set in the main
theme file.

fixes #666
2020-06-29 20:07:24 +02:00
tobi-wan-kenobi
9136ebd321 [core/input] clear previous input registrations
make sure that for a given event (widget/object/module, whatever), only
a *single* input event per button can be registered at one time.

the problem otherwise is with modules that re-register their widgets
with the same IDs (cmus, spotify, etc.): Each time the widget is
re-created (each intervall, typically), it re-registers an input event,
creating an always longer list of callbacks being executed when the
button is clicked (not speaking of the memory leak this introduces).

fixes #668
2020-06-29 07:44:22 +02:00
tobi-wan-kenobi
6b09be1993 Revert "[core/theme] Make theme iconsets *not* override settings"
This reverts commit 320bba97d0.
2020-06-28 20:09:55 +02:00
tobi-wan-kenobi
320bba97d0 [core/theme] Make theme iconsets *not* override settings
Make sure that iconsets used as part of a theme do *not* override
anything already existing inside the theme.

Only iconsets that are manually specified can override settings in the
theme now (because those, you typically specify on the CLI).

TODO: Write unit test for this

fixes #666
2020-06-28 20:01:08 +02:00
tobi-wan-kenobi
72deb7eaf8 [modules] add speed test module 2020-06-25 20:34:35 +02:00
Tobias Witek
441e7d5041 [core] fix minimize for all modules (nic, traffic, etc.)
make it possible to toggle the display state of a widget between
"displayed" and "minimized" also for modules that re-create their
widgets during each iteration.

see #661
2020-06-23 20:03:17 +02:00