Commit graph

125 commits

Author SHA1 Message Date
tobi-wan-kenobi
5fd9501ed2 [core/output] Add parameter "align"
Also, add some documentation
2020-05-03 11:41:30 +02:00
tobi-wan-kenobi
30c1f712a6 [formatting] reformat using "black -t py34"
getting rid of thinking about consistent formatting...
2020-05-03 11:15:52 +02:00
tobi-wan-kenobi
b3d70c61f1 [core/config] ast is part of the PSL 2020-05-02 13:57:13 +02:00
tobi-wan-kenobi
ba24ba13db [core/input] add default workspace wrap bindings (mouse wheel up/down) 2020-05-02 13:54:45 +02:00
tobi-wan-kenobi
d0bb0f9b7a [core/config] Add support for configuration files
Load configuration files from a number of places and, if they exist, use
the settings there as baseline settings that can be overwritten by more
specific source (the modules themselves and the CLI `--parameter`
option).

TODO: document this
2020-05-02 13:43:17 +02:00
tobi-wan-kenobi
bac38ece5d [core/module] only log an error when a module cannot be loaded
improve logging of import errors

see #606
2020-05-02 13:29:20 +02:00
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
8e71201030 [core/module] name of a widget now equals the module name
to make it easier to trigger events programmatically, the IDs for
modules are not auto-generated UUIDs anymore, but rather the module name
(which has to be unique, anyhow).
2020-05-02 09:40:09 +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
87915a34e9 [core] get output for list of themes/modules 2020-05-01 20:15:39 +02:00
tobi-wan-kenobi
2ab575d190 [core] do not scroll errors
to make errors easier to diagnose, do not scroll them, but instead fully
show them.

also, re-introduce the supplementary fields for the dwm bridge, kudos to
@somospocos
2020-05-01 15:34:29 +02:00
tobi-wan-kenobi
4daae88a7c [core] Add right-to-left output 2020-05-01 15:34:29 +02:00
tobi-wan-kenobi
2a663deb7b [core/modules] Add widget producer for module
simplifies and debugs widget creation
2020-05-01 10:03:50 +02:00
tobi-wan-kenobi
595778f7c3 [core/config] enable logging into a log file
Re-enable the -f | --logfile parameter, but still default to logging to
stderr.

Also, add a "debug" module that is automatically displayed if a bar is
run in debug mode (thanks to @bbernhard for the excellent suggestion)

fixes #614
2020-05-01 09:42:26 +02:00
tobi-wan-kenobi
39d139a51b [core/output] Use string format for interval
see #609
2020-04-30 20:18:42 +02:00
tobi-wan-kenobi
88e56c4c47 [core] Add '-d' as shorthand for '--debug'
see #606
2020-04-30 12:52:09 +02:00
tobi-wan-kenobi
1e4955d4b8 [core/module] Make name and module_name attributes 2020-04-30 12:50:24 +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
611bed2007 [core/output] Always hide modules that use "hidden()" 2020-04-29 14:39:12 +02:00
tobi-wan-kenobi
32444ed49f [modules/cmus] Update to latest API 2020-04-28 20:25:28 +02:00
tobi-wan-kenobi
f1341772e5 [core/output] Evaluate "hidden()" callback of modules 2020-04-28 20:13:31 +02:00
tobi-wan-kenobi
28bdf4355b [core] Add theme to modules 2020-04-26 16:40:48 +02:00
tobi-wan-kenobi
1f94eab927 [core] Add themes to module constructor 2020-04-26 16:39:13 +02:00
tobi-wan-kenobi
cfa1a5c896 [modules/cpu2] Update to latest API 2020-04-26 10:34:25 +02:00
tobi-wan-kenobi
b87dcad9c2 [core/module] For errors, always set update interval to 1 2020-04-13 09:43:45 +02:00
tobi-wan-kenobi
94ef496ee6 [core] Add a decorator for never updating a module 2020-04-13 09:27:03 +02:00
tobi-wan-kenobi
9e32cdef5d [core] Rename events for more clarity 2020-04-12 20:11:02 +02:00
tobi-wan-kenobi
07ca5cf383 [core/output] Make it possible to update modules via events
Add an event callback "update-modules" that allows various pieces of
bumblebee-status to update the status bar.
2020-04-12 14:44:02 +02:00
tobi-wan-kenobi
4cd6444bbf [core/theme] Improve items that are lists
Until now, using a list as prefix/suffix didn't work as expected,
because the corresponding method for retrieving the value was called
multiple times, and each time, the next icon would be retrieved.

Changed the logic inside the theme to only update the indices every time
that an actual update was happening.
2020-04-12 14:01:51 +02:00
tobi-wan-kenobi
1a5a324498 [core/module] improved handling of import errors
Now, the error message includes the name of the module that was not
imported, and there's checks to ensure the "more specific" error (i.e. a
failing import *inside* the module) "wins".
2020-04-11 12:59:39 +02:00
tobi-wan-kenobi
1cab99175b [core/theme] slight improvements for clarity 2020-04-10 16:56:15 +02:00
tobi-wan-kenobi
99a6a11e3a [core/output] Fix drawing of separator backgrounds 2020-04-08 14:13:18 +02:00
tobi-wan-kenobi
20044762af [core/config] Ignore malformed parameters 2020-04-08 11:50:00 +02:00
tobi-wan-kenobi
f22561cf90 [core/module] remove debug output 2020-04-08 11:48:16 +02:00
tobi-wan-kenobi
cde06bd33b [core/module] Re-enable aliases 2020-04-07 21:23:42 +02:00
tobi-wan-kenobi
c4762d92f7 [core/theme] slight refactoring 2020-04-07 21:00:55 +02:00
tobi-wan-kenobi
32e5d633f4 [core/output] Add tests for pango formatting 2020-04-07 20:59:26 +02:00
tobi-wan-kenobi
c0cc1ccd75 [core] Remove "intelligent" theme accessors
To simplify code, remove the auto-generated theme accessors for
attributes, and instead use a generic "get" method.
2020-04-07 20:44:01 +02:00
tobi-wan-kenobi
23215303ca [core] Add "merged" pango support
With this commit, it is possible to add pango directives inside every
piece that supports direct output (e.g. defaults/prefix or <module
name>/prefix) and those will be merged - i.e. it is possible to specify
defaults inside "defaults" and override/specify in the particular
modules.
2020-04-05 14:57:52 +02:00
tobi-wan-kenobi
e653624f5a [core/output] Re-enable basic pango support
Re-enable pango as simple "pango" dict wherever a normal value (e.g.
prefix, suffix) can go.
2020-04-05 14:27:09 +02:00
tobi-wan-kenobi
37cca1c3b9 [core/output] Fully switch to i3 block abstraction
According to the unit tests, at least, the old functionality is back
again - with the additional i3 block abstraction in output in place.

Also, pango support is temporarily removed again and will be
re-implemented based on the new architecture.
2020-04-05 13:58:59 +02:00
tobi-wan-kenobi
f5052473fb [core] Add preliminary block abstraction to output
The idea is to simplify the way the output module currently works by:
- introducing an abstraction that represents blocks; these abstractions
  contain all data - uninterpreted - required to draw a block
- separately from that, whenever the block is serialized into JSON,
  do the interpretation (pango vs. non-pango, etc.)

This - theoretically - should simplify code by creating two separate
concerns: collecting the data and actually interpreting it.
2020-04-05 10:53:17 +02:00
tobi-wan-kenobi
b5c2ca6ccf [core/output] Add generic pango support
Allow any piece of a theme that specifies a set of attributes (default,
cycles, states, widgets) to use pango *instead* of the usual attributes.

If pango is present, this will have precedence.

A practical example of this can be found in the powerline-pango theme,
which is added solely for demonstration purposes.

fixes #531
2020-04-04 14:38:37 +02:00
tobi-wan-kenobi
89247d834b [core/widget] Use __ for private variables 2020-04-04 13:58:22 +02:00
tobi-wan-kenobi
7547537c81 [core/event] Remove debug output 2020-04-04 13:57:54 +02:00
tobi-wan-kenobi
a6eb6c3a11 [core/output] Use __ for private variables 2020-04-04 13:57:42 +02:00
tobi-wan-kenobi
3aeec1c7e6 [core/module] Use __ for private variables 2020-04-04 13:55:54 +02:00
tobi-wan-kenobi
476b2000f9 [core/config] Use __ for private variables and methods 2020-04-04 13:54:08 +02:00
tobi-wan-kenobi
04fc9867ac [core/input] Move event handling to core.event
Until now, bumblebee-status did event handling in two places with almost
identical code: in core.event (makes sense) and core.input (still makes
sense, but a bit more dubious).

Changed core.input to use core.event
2020-04-04 13:52:10 +02:00