Commit graph

18 commits

Author SHA1 Message Date
tobi-wan-kenobi
972ada0697 [core/widget] allow to override widget IDs
to uniquely identify a widget, allow the user to specify an ID on the
CLI

TODO: document this
2020-05-02 09:41:08 +02:00
tobi-wan-kenobi
a8ab4f9509 [core/output] allow specification of per-widget modified
make it possible to specify the minimum width of all widgets via:

`-m cpu -p cpu.theme.minwidth=20`

or

`-m cpu -p cpu.theme.minwidth=aaaaaa`

multiple widgets are comma-separated (missing entries will have no
minwidth)

`-m sensors2 -p sensors2.theme.minwidth=10,20,10`

see #606

TODO add to documentation
2020-05-01 20:25:10 +02:00
tobi-wan-kenobi
b27956071f [core/widget] Make module an attribute
Instead of having an artifical getter/setter method, just make module a
plain attribute.
2020-04-30 12:46:57 +02:00
tobi-wan-kenobi
9cd9ff626d [core] make widget name an attribute
first, this fixes #607

also, i think it slightly simplifies code to make "simple" stuff like
names, etc. attributes instead of methods all the time.

so, expect this to be extended to other components, as well.
2020-04-30 12:42:34 +02:00
tobi-wan-kenobi
89247d834b [core/widget] Use __ for private variables 2020-04-04 13:58:22 +02:00
tobi-wan-kenobi
908ef67109 [core/widget] bump test coverage 2020-03-27 13:54:22 +01:00
Tobias Witek
5851b104c5 [modules/xrandr] Adapt to new API 2020-03-13 13:56:08 +01:00
Tobias Witek
47e8d5b82b [core] replace widget.minwidth with widget.set('theme.minwidth') 2020-03-07 13:21:19 +01:00
Tobias Witek
d2e8057141 [modules] Add CPU module
Also, change minwidth from theme.minwidth to widget property
2020-03-06 14:33:40 +01:00
Tobias Witek
533b8ca0cc [modules] Re-add module nic 2020-03-01 14:36:12 +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
1a093a73b1 [core] Add prefix/postfix support 2020-02-24 14:54:11 +01:00
Tobias Witek
84833dc7db [core] Add (partial) support for states
Add states to the modules and widgets. Widgets are mostly just a
pass-through (backwards compatibility, and ease of use - making states
directly inside the widgets would require more code inside the modules
to ensure that each widget is correctly updated).

Still missing:
- Separators during partial update (right now, it takes one interval
until separators are drawn correctly)
2020-02-23 21:13:49 +01:00
Tobias Witek
65186baea6 [core] Make error widget scrollable
Restrict error module to 15 characters and make it scrollable.
2020-02-23 14:47:47 +01:00
Tobias Witek
fca364554e [core/output] Add id of widget and module to output
In the process of that, fix a bug in how the parent class constructors
were invoked.
2020-02-08 13:45:52 +01:00
Tobias Witek
f9267f2131 [core/widget] fix small bug (wrong indentation) 2020-02-07 21:32:20 +01:00
Tobias Witek
6adc497f68 [core] Add support for module parameters
Parse '-p' parameters and make them accessible via 'parameter()' from
within a module (basically, restore the previous configuration
facility).

Still TODO: Add support for configuration files.
2020-02-04 21:09:11 +01:00
Tobias Witek
fee7cf7882 [core/widget] Add widget class
To maintain backwards compatibility (and because I think it's an OK
design choice), keep the widget concept (a single module can produce
multiple widgets).
2020-01-26 13:58:29 +01:00