Commit graph

18 commits

Author SHA1 Message Date
Tobias Witek
ba843355eb [engine/popup] Make tkinter module optional
If tkinter is not available, status bar should still work as expected
(but all the popup functionality will not work and likely throw errors).
2017-06-16 15:36:56 +02:00
Tobias Witek
7d13268f66 [engine] Report current module when error occurs
Keep track of the latest updated module in the engine part, so that the
module causing an exception can be reported correctly.

fixes #110
2017-06-10 14:08:49 +02:00
Tobias Witek
9b0c9a49e8 [core] Cleanly abort on ctrl+c
During debugging, being able to cleanly (i.e. without backtrace) exit
using ctrl+c is a very welcome functionality :)
2017-05-13 20:28:11 +02:00
tobi-wan-kenobi
dc3881d99e [core] Make logging work in (hopefully) all situations
* Unless debugging has been enabled, log to stderr (i.e. do *not* try to
open a file)
* When debugging into a file, choose a location that is likely to be
writeable by the user (i.e. the user's home directory)
* Location of the logfile can also be specified
    
fixes #62
2017-04-04 15:15:50 +02:00
Tobias Witek
0e502cef25 [bumblebee-status] Add missing import for error module 2017-04-02 08:56:44 +02:00
Tobias Witek
251f8d2e9f [core] Add debugging capabilities
* If an exception is thrown, catch it and show a (somewhat) nice error
  message in the i3bar instead of the normal content
* Add a flag "-d" for debugging into a debug log. Currently, this only
  logs commandline calls as they occur and their return values, as well
  as exceptions.

fixes #58
2017-04-02 08:31:23 +02:00
Tobi-wan Kenobi
225d471c6a [modules/cpu] Add configurable warning and critical thresholds
The cpu module now has cpu.warning and cpu.critical thresholds. If the
CPU utilization is higher than any of those values, the widget's state
changes to warning or critical, respectively.

see #23
2016-12-10 08:09:13 +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
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
8855f1155b [core/errors] Add custom exceptions
Add custom exceptions and add error handling to the engine's module
loading logic. I.e. when a non-existent module is loaded, an exception
is thrown now.

see #23
2016-12-04 16:23:44 +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
cf1693548b [engine] Add initial version of event loop engine
Re-add the engine that is responsible for tying together input, output,
etc.

see #23
2016-12-04 08:37:56 +01:00
Tobi-wan Kenobi
a8a6c9bba2 [core] Refactor engine
This is going to be a bit more comprehensive than anticipated. In order
to cleanly refactor the core and the engine, basically start from
scratch with the implementation.

Goals:

* Test coverage
* Maintain backwards compatibility with module interface as much as
  possible (but still make modules easier to code)
* Simplicity

see #23
2016-12-03 20:38:54 +01:00
Tobias Witek
3af8ee771d [general] Refactoring
* remove (hopefully) unnecessary import statements
* make some code a bit more compact
* remove dead code ... again: hopefully so
2016-11-05 15:54:34 +01:00
Tobias Witek
a58610f3ee [config] Start refactoring by creating separate config class
Add a class that will hold all configuration and argument information
and serve as central repository for this kind of information.
2016-11-05 07:54:36 +01:00
Tobias Witek
55474aadc3 [general] Minor refactoring
Shuffled some code around in an attempt to make it easier to read and
understand.
2016-11-04 21:41:22 +01:00
Tobias Witek
d62258c89d [all] Major refactoring
Introduce an "Engine" class to abstract some of the details of loading
modules, registering events, etc.
2016-11-04 21:03:12 +01:00
Tobias Witek
a6bdd0557c [doc] rename i3bumblebee -> bumblebee-status
As the prefix i3* is reserved for official i3 packages, rename
i3bumblebee to bumblebee-status.
2016-11-04 20:20:46 +01:00
Renamed from i3bumblebee (Browse further)