Commit graph

16 commits

Author SHA1 Message Date
Tobias Witek
94c72a1e6a [tests] Fix failing test for i3bar protocol 2017-04-26 07:50:27 +02:00
Tobias Witek
0f34826cac [tests] Fix broken tests caused by new theme methods
Add "minwidth()" and "align()" mocks for i3bar output tests.
2017-04-22 13:14:52 +02:00
Tobi-wan Kenobi
e4f728327e [tests] Fix imports for Python3 compatibility 2017-03-05 09:40:15 +01:00
Tobi-wan Kenobi
728cb73189 [test_i3bar-output] Added i3bar output test modules 2017-03-05 09:34:47 +01:00
Tobi-wan Kenobi
6dbe440cb5 [tests] Purge tests and start with a clean implementation of subprocess
Seems like subprocess and friends (Popen, communicate) are not so easy
to mock cleanly. Therefore, start from scratch and carefully write test
by test, until (at least) the old test coverage has been restored.
2017-03-04 11:25:52 +01:00
Tobi-wan Kenobi
e72c25b0bc [core] Add input processing
Create infrastructure for input event handling and add i3bar event
processing. For each event, callbacks can be registered in the input
module.
Modules and widgets both identify themselves using a unique ID (the
module name for modules, a generated UUID for the widgets). This ID is
then used for registering the callbacks. This is possible since both
widgets and modules are statically allocated & do not change their IDs.

Callback actions can be either callable Python objects (in which case
the event is passed as parameter), or strings, in which case the string
is interpreted as a shell command.

see #23
2016-12-09 19:29:16 +01:00
Tobi-wan Kenobi
068968bbf5 [tests] Refactor by removing getter/setter methods
Instead of having get/set methods for simple attributes, use the
attributes directly.

see #23
2016-12-09 11:42:02 +01:00
Tobi-wan Kenobi
c52cb99518 [core/theme] Add support for foreground and background colors
Themes can now define "fg" and "bg" attributes that are used for
foreground (text) color and background color.

see #23
2016-12-09 09:02:19 +01:00
Tobi-wan Kenobi
f40418475f [modules/datetime] Re-enable datetime module
Add datetime module + aliases date and time.

see #23
2016-12-09 07:11:23 +01:00
Tobi-wan Kenobi
2fa8d7b778 [core/themes] Add module-specific themes
Allow module-specific theme information to overload "default"
configuration. I.e. it is now possible to have specific prefix or
postfix configurations for different modules. The module name is derived
for each widget from the module (__module__) from which it was
instantiated.

see #23
2016-12-08 12:44:52 +01:00
Tobi-wan Kenobi
394ef61760 [core/theme] Add support for default -> prefix/suffix in themes
Themes can now define default prefix and suffix strings.

see #23
2016-12-08 11:52:47 +01:00
Tobi-wan Kenobi
64f5fc100e [core/theme] Add prefix/postfix methods
Add a way to specify prefix and postfix strings to the full text of a
widget's text. Currently, the theme does not fill those yet.

see #23
2016-12-08 11:31:20 +01:00
Tobi-wan Kenobi
aacc56a4e2 [modules/cpu] Add initial version of CPU utilization module
Re-enable the CPU utilization module as proof-of-concept for the new
core engine.

see #23
2016-12-04 17:45:42 +01:00
Tobi-wan Kenobi
b6eb3ee8e6 [output/i3bar] Add flush method
flush() terminates a single iteration of widget drawing.

see #23
2016-12-04 16:14:43 +01:00
Tobi-wan Kenobi
712d958e18 [core/output] Add widget drawing
Add basic drawing of widgets. Each module instance returns a list of
widgets using the widgets() method which is then forwarded to the draw()
method of the configured output.

see #23
2016-12-04 12:53:18 +01:00
Tobi-wan Kenobi
6f52825ef0 [core/output] Add initial version of i3bar output
Add output handler for i3bar protocol and add some tests for it. Right
now, it only support start and end.

see #23
2016-12-04 12:26:20 +01:00