Skip to content

Commit

Permalink
Merge pull request #1035 from TheEdgeOfRage/oled
Browse files Browse the repository at this point in the history
Add oled_offset module
  • Loading branch information
tobi-wan-kenobi authored Jan 6, 2025
2 parents a28897f + 03ada54 commit f274eaf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
27 changes: 27 additions & 0 deletions bumblebee_status/modules/contrib/oled_offset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# pylint: disable=C0111,R0903

"""Creates an empty widget that changes width on a timer,
to reduce changes o OLED burn-in from other bumblebee modules.
You should put this module as the last one,
so all the other modules are moved when this one changes in width
contributed by `TheEdgeOfRage <https://github.com/TheEdgeOfRage>`_ - many thanks!
"""

import core.module
import core.widget
import core.decorators


class Module(core.module.Module):
@core.decorators.every(minutes=1)
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.content))
self.__offset = 0

def content(self, _):
return self.__offset * " "

def update(self):
self.__offset = (self.__offset + 1) % 3
5 changes: 5 additions & 0 deletions tests/modules/contrib/test_oled_offset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pytest

def test_load_module():
__import__("modules.contrib.oled_offset")

3 changes: 3 additions & 0 deletions themes/icons/awesome-fonts.json
Original file line number Diff line number Diff line change
Expand Up @@ -742,5 +742,8 @@
},
"power-profile": {
"prefix": "\uF2C1"
},
"oled_offset": {
"padding": ""
}
}

0 comments on commit f274eaf

Please sign in to comment.