Commit graph

20 commits

Author SHA1 Message Date
Ishaan Bhimwal
a5fbc73c44 fix typo 2022-07-21 11:37:33 +05:30
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
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
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
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
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
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
w1kl4s
1a7ae9ecc6 Fix Python 3.9 compatibility
Replaced threading.Thread.isAlive() with threading.Thread.is_alive()
2020-10-14 18:07:29 +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
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
547874dafd [core/module] allow modules to perform updates in background
a module can now set `self.background = True` in its `__init__()` method
to make sure its update method is invoked in a separate thread.

also, do a PoC implementation of this for the github module.

TODO: add this to dev doc

see #640
2020-05-30 17:22:02 +02:00
tobi-wan-kenobi
e359c75603 [core/widget] remove module from widget initializer 2020-05-18 12:59:47 +02:00
tobi-wan-kenobi
a697500491 [core] add debugging around click events
log commandline outputs and errors. allow input handlers to be
configured as "waiting" for debugging purposes.

see #628
2020-05-16 15:16:23 +02:00
tobi-wan-kenobi
02a80840a1 [core] more black'ing 2020-05-16 12:00:55 +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
835ed070e5 [core/module] Add docstrings 2020-05-15 10:22:10 +02:00
tobi-wan-kenobi
b803f385a1 [tests] Fix failing tests 2020-05-10 12:56:30 +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
Renamed from core/module.py (Browse further)