Commit graph

21 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Tobias Witek
b2e92d816d [tests] add pytest for core.output
see #642
2020-06-20 14:51:49 +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/output.py (Browse further)