From fbbd95b7a83eb1257d72dabedb93d9b619652a38 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Mon, 18 May 2020 12:56:41 +0200 Subject: [PATCH 1/4] [modules/network_traffic] Minor refactoring --- bumblebee_status/modules/contrib/network_traffic.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/bumblebee_status/modules/contrib/network_traffic.py b/bumblebee_status/modules/contrib/network_traffic.py index b90c1c5..bd1a9b6 100644 --- a/bumblebee_status/modules/contrib/network_traffic.py +++ b/bumblebee_status/modules/contrib/network_traffic.py @@ -32,9 +32,6 @@ class Module(core.module.Module): ] super().__init__(config, theme, widgets) - self.widgets()[0].module = self - self.widgets()[1].module = self - self.widgets()[0].set("theme.minwidth", "0000000KiB/s") self.widgets()[1].set("theme.minwidth", "0000000KiB/s") From e359c75603f1b8020e6feebe95ac688689d594c5 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Mon, 18 May 2020 12:59:47 +0200 Subject: [PATCH 2/4] [core/widget] remove module from widget initializer --- bumblebee_status/core/module.py | 3 ++- bumblebee_status/core/widget.py | 4 ++-- docs/other/NOTES.md | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bumblebee_status/core/module.py b/bumblebee_status/core/module.py index ba06848..dfc229e 100644 --- a/bumblebee_status/core/module.py +++ b/bumblebee_status/core/module.py @@ -154,8 +154,9 @@ class Module(core.input.Object): """ def add_widget(self, full_text="", name=None): - widget = core.widget.Widget(full_text=full_text, name=name, module=self) + widget = core.widget.Widget(full_text=full_text, name=name) self.widgets().append(widget) + widget.module = self return widget """Convenience method to retrieve a named widget diff --git a/bumblebee_status/core/widget.py b/bumblebee_status/core/widget.py index ea6e6be..eae6f74 100644 --- a/bumblebee_status/core/widget.py +++ b/bumblebee_status/core/widget.py @@ -6,10 +6,10 @@ import util.format class Widget(util.store.Store, core.input.Object): - def __init__(self, full_text="", name=None, module=None): + def __init__(self, full_text="", name=None): super(Widget, self).__init__() self.__full_text = full_text - self.module = module + self.module = None self.name = name @property diff --git a/docs/other/NOTES.md b/docs/other/NOTES.md index 4ff62c4..d6dd4d8 100644 --- a/docs/other/NOTES.md +++ b/docs/other/NOTES.md @@ -10,6 +10,7 @@ ## Improvements - app launcher (list of apps, themeable) +- github pages? ## TODO - themes: use colors to improve theme readability From 922575fcdac429a800cb2a0d03a73a54e291ff47 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Mon, 18 May 2020 13:13:06 +0200 Subject: [PATCH 3/4] [core/widget] make arbitrary modules scrollable Use a boolean parameter "scrolling" that's applied generically to modules to allow arbitrary modules to scroll. see #606 TODO: Add to documentation --- bumblebee_status/core/widget.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bumblebee_status/core/widget.py b/bumblebee_status/core/widget.py index eae6f74..dd9fe1f 100644 --- a/bumblebee_status/core/widget.py +++ b/bumblebee_status/core/widget.py @@ -1,9 +1,13 @@ +import logging + import core.input import core.decorators import util.store import util.format +log = logging.getLogger(__name__) + class Widget(util.store.Store, core.input.Object): def __init__(self, full_text="", name=None): @@ -27,6 +31,13 @@ class Widget(util.store.Store, core.input.Object): custom_ids = util.format.aslist(module.parameter("id")) if len(custom_ids) > self.index(): self.id = custom_ids[self.index()] + if util.format.asbool(module.parameter("scrolling", False)) == True: + if callable(self.__full_text): + self.__full_text = core.decorators.scrollable( + self.__full_text.__func__ + ).__get__(module) + else: + log.warning("unable to make scrollable: {}".format(module.name)) def index(self): if not self.module: From 0dc4e6c7096eb45f1f23e3adde805eb370138bdc Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Wed, 20 May 2020 17:28:41 +0200 Subject: [PATCH 4/4] [docs] add downgrade instructions --- docs/FAQ.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/FAQ.rst b/docs/FAQ.rst index c2a1513..ff00d23 100644 --- a/docs/FAQ.rst +++ b/docs/FAQ.rst @@ -14,11 +14,11 @@ If that is not an acceptable solution, here are different ways to step back to the last stable version: git - ``git checkout v1.10`` + ``git checkout v1.10.4`` pip - ``pip install --user --force-reinstall bumblebee-status==1.10`` + ``pip install --user --force-reinstall bumblebee-status==1.10.4`` aur - TODO + ``# checkout rev. 9a53906a0decf30946c22976c8b4f34ab4354d74 from https://aur.archlinux.org/bumblebee-status.git` My bar doesn’t show any background colors -----------------------------------------