Commit graph

100 commits

Author SHA1 Message Date
me
f44d48e7bd [core/output] micro-optimization refactoring
If markup isn't pango, skip the add_prefix_colors() call entirely
2020-02-12 18:11:22 +02:00
me
d1238f9dca [core/output] make prefix bg/fg variables instance variables
There are plans to use them in more than one method
2020-02-12 18:08:03 +02:00
me
f988be041f [core/output] rename variables to more suggestive names
Getting ready for next small refactoring.
2020-02-12 18:04:45 +02:00
me
ed256a960d extract add_prefix_colors() method 2020-01-31 12:31:38 +02:00
me
64c675150e extract escape_amp() method 2020-01-31 12:27:39 +02:00
me
beff99888b extract add_suffix() method 2020-01-31 12:11:51 +02:00
me
4855b1aa0a extract add_prefix() method 2020-01-31 12:09:45 +02:00
me
2166a26967 make full_text an instance variable
it will be used in more than one method
2020-01-31 12:04:44 +02:00
me
1f0f1c1722 make markup an instance variable
it will be used in more than one method
2020-01-31 12:00:15 +02:00
me
ea1c0b7043 query config for markup before processing prefix/suffix 2020-01-31 11:56:07 +02:00
me
333a1f9907 only query config for markup value once 2020-01-31 11:53:25 +02:00
me
a3cfe0abbe create variable just before using it 2020-01-31 11:47:21 +02:00
me
4a7a26456d make prefix/suffix instance variables
they will be used in more than one method
2020-01-31 11:44:07 +02:00
me
9d8c1f910e when there's nothing to return, do it ASAP 2020-01-31 11:37:42 +02:00
me
289a40ff72 add JSON separator block at the beginning of draw() 2020-01-31 11:34:17 +02:00
me
8a16d3cb3a extract method 2020-01-31 11:30:48 +02:00
me
e2bc263520 [fix] always return a list, even empty 2020-01-31 11:19:59 +02:00
me
f5f09bdb1b [core/output] extract I3BarOutput.draw() into a class 2020-01-31 11:16:26 +02:00
me
11f16bd1aa [doc] improve docstring 2020-01-31 10:57:30 +02:00
me
6bfb0fb513 [core/output] add support for drawing graphs using Braille chars 2020-01-19 12:32:12 +02:00
Tobias Witek
629b3381f2 [theme] Add pango markup for prefix/suffix
Add 4 new theme specifiers:
- prefixfg
- prefixbg
- suffixfg
- suffixbg

All of those are only evaluated if markup type is pango, and result in
pango-formatted prefixes/suffixes.

fixes #520
2020-01-11 13:54:53 +01:00
me
c45c5134a7 add txtbars 2020-01-01 22:22:31 +02:00
Tobias Witek
5266e08a26 [core/output] Escape pango output
Make sure any "&" are properly escaped if using pango markup.

fixes #507
2019-12-30 13:29:34 +01:00
Tobias Witek
2e26f6d0c4 [core] Log parameter that were not used after each draw
Whenever a new bar is being drawn, log out all parameters that were not
used at all. This might indicate a bug in the module, or might point to
a spelling error in the parameter name.

fixes #494
2019-12-25 13:40:02 +01:00
Tobias Witek
43aaa28256 [core/output] Add specific --markup parameter
To allow a user to specify a custom markup string, add a parameter
"--markup" to bumblebee-status.

fixes #493
2019-12-24 13:55:36 +01:00
Tobias Witek
185655de26 [output] Add support for pango markup
Add a new parameter "output.markup" that allows a user to pass in a
custom markup string (e.g. "pango").

Note: To make use of this, the user still has to use a Pango font, as
well as use a bumblebee-status module that supports Pango output.

fixes #493
2019-12-23 13:27:46 +01:00
tobyp
cc9e641561 Support disabling scrollable by setting width=-1 on the module 2019-11-10 23:31:24 +01:00
WORD559
f1410b7c1f Use util.asbool rather than manual true-value parsing 2019-10-03 16:36:26 +01:00
WORD559
c8d5346d81 Add parameter to prevent scrollable decorator from fixing the module width 2019-10-02 21:30:55 +01:00
Tobias Witek
47eeac00a0 Revert "Merge branch 'partial-update-on-input'"
This reverts commit a2cc828e58, reversing
changes made to 87f185e62b.
2019-01-26 19:40:08 +01:00
Tobias Witek
d9df96adcb Merge branch 'master' into partial-update-on-input
To make sure that all conflicts are resolved and because the
autohide feature is so nice.
2019-01-19 14:56:25 +01:00
Tobias Witek
7b07ef538a [core] Add "autohide" for distraction-free programming
Add a new parameter "-a|--autohide" that allows you to specify a
list of module names (or aliases) that will be hidden from the bar
*unless* their state is either warning or critical.
2019-01-19 14:51:48 +01:00
Tobias Witek
2b91ce5861 [core/output] Refactor full/partial refresh
Creating the "raw", cached widget data out of the widget object was done
two places now.

see  #353
2019-01-19 14:12:32 +01:00
Tobias Witek
3d9279c444 [core] Update only affected widgets on input event
When receiving an input event, only update affected widgets, identified by
their instance ID.

see #353
2019-01-19 14:07:17 +01:00
WORD559
8ea9762472 Modified behaviour of bumblebee.output.scrollable to allow for custom scroll speed and toggling "bouncing" of text, and applied it to deadbeef and spotify 2018-12-28 21:27:38 +00:00
Tobias Witek
7d55bdce6c [engine/output] Use (experimental) custom widget padding
When padding a widget, instead of using the "min_width" field of the
i3bar protocol, which seems to "swallow" click events, perform a custom
padding by simply extending the right-hand side with spaces.

fixes #334
2018-11-25 17:50:05 +01:00
Tobias Witek
e80ae8b91e [core] Add option to draw widgets right-to-left
fixes #295
2018-09-22 14:40:32 +02:00
Tobias Witek
7152bb17f2 [core] Generic collapsible widgets
Each widget can now be collapsed and expanded using the middle mouse
click, by default.
2018-09-15 14:40:52 +02:00
Tobias Witek
290f95d6b4 [core] Collapse modules by using middle mouse
When pressing the middle mouse button (and it's not assigned to any
other functionality), the module (i.e. all widgets of that module) will
disappear and be replaced with the module's icon (or prefix, as
fallback) and an ellipsis.

fixes #264
2018-05-30 10:42:31 +02:00
Tobias Witek
650e0b933e Revert "[modules/getcrypto] Deal with kraken service downtime"
This reverts commit 3615e60e5b.

Time to go to sleep, so many mistakes...
2018-01-11 20:31:48 +01:00
Tobias Witek
3615e60e5b [modules/getcrypto] Deal with kraken service downtime
see #222
2018-01-11 20:29:45 +01:00
Frederic Junod
70a58715f3 Fix unused-variables errors found by pylint 2017-10-18 08:36:07 +02:00
Tobias Witek
9f69cc6ae9 [core] Add ability to "hide" a module with all its widgets
* A module can override the method "hidden" to specify when all it's
widgets should be hidden.
* Implement hidden for cmus and spotify
* Fix problem that cmus widgets were not displayed correctly

fixes #157
2017-08-12 17:03:04 +02:00
Yves Hoppe
ec2b39f04c
[Output] Only draw widget when full text is not empty 2017-05-26 21:36:01 +02:00
Tobias Witek
fdcc908d83 [core] Use class theme, if no specific module theme matches
For modules that use aliases, until now, *only* the alias theme was
considered. This is typically a bad idea (tm), as the "generic" case is
that of a module theme (e.g. "disk", not that of a theme per instance of
the module (i.e. "home", "root", etc.)).

Therefore, introduce the concept of a "class" theme that can be
optionall overridden by a specific module theme.

As a pleasant side-effect, this should bring back the disk icons for all
instances of the disk module :)

fixes #79
2017-05-10 20:01:29 +02:00
Tobias Witek
02f3559734 [input] Terminate i3 protocol header with newline
According to https://i3wm.org/docs/i3bar-protocol.html, the header block
needs to be terminated by a newline.

fixes #76
2017-04-26 07:37:47 +02:00
Tobias Witek
2e5ea91291 Merge branch 'meain-traffic' 2017-04-23 07:18:15 +02:00
Tobias Witek
1a82a717fa [core] Calculate minwidth including pre/suffix
Add the length of the prefix and suffix to the minimum width, if
applicable.
2017-04-23 07:15:07 +02:00
Tobias Witek
928940d848 [core] Add a "scrollable" modifier for widget texts callbacks
If a module defines a callback for a widget's text, an optional
decorator "@bumblebee.output.scrollable" can be used to make the text
scrollable.

In those cases, the desired width is set to (in decreasing order of
priority):
1. whatever the widget defines as "theme.width"
2. whatever the theme defines as "width" for the module
3. whatever the commandline parameter "width" for the module is set to
4. 30 (determined by unfair dice roll)

see #27
2017-04-22 13:07:50 +02:00
Tobias Witek
92be7d3020 [core] Added min-width and alignment themeing
Added theme-options ("minwidth" and "align") for setting the minimum
width and the alignment of a widget.

Also, allow widget to provide defaults for the theme options by setting
an attribute in their store called "theme-<name of the theme option>".

For example, a widget can now define a default alignment by using:
widget.set("theme-align", "default-value").
2017-04-22 13:00:53 +02:00