diff options
-rw-r--r-- | src/tiptop/__about__.py | 2 | ||||
-rw-r--r-- | src/tiptop/_app.py | 22 | ||||
-rw-r--r-- | src/tiptop/braille_stream.py | 7 |
3 files changed, 17 insertions, 14 deletions
diff --git a/src/tiptop/__about__.py b/src/tiptop/__about__.py index d3ec452..3ced358 100644 --- a/src/tiptop/__about__.py +++ b/src/tiptop/__about__.py @@ -1 +1 @@ -__version__ = "0.2.0" +__version__ = "0.2.1" diff --git a/src/tiptop/_app.py b/src/tiptop/_app.py index 2a53505..e0f9014 100644 --- a/src/tiptop/_app.py +++ b/src/tiptop/_app.py @@ -76,22 +76,24 @@ def run(argv=None): grid.add_column(fraction=34, name="right") if psutil.sensors_battery() is None: - grid.add_row(size=1, name="topline") - grid.add_row(fraction=1, name="top") - grid.add_row(fraction=1, name="center") - grid.add_row(fraction=1, name="bottom") + grid.add_row(size=1, name="r0") + grid.add_row(fraction=1, name="r1") + grid.add_row(fraction=1, name="r2") + grid.add_row(fraction=1, name="r3") grid.add_areas( - area0="left-start|right-end,topline", - area1="left-start|right-end,top", - area2a="left,center", - area2b="left,bottom", - area3="right,center-start|bottom-end", + area0="left-start|right-end,r0", + area1="left,r1", + area2a="right,r1", + area2b="right,r2", + area2c="right,r3", + area3="left,r2-start|r3-end", ) grid.place( area0=InfoLine(), area1=CPU(), area2a=Mem(), - area2b=Net(args.net), + area2b=Disk(), + area2c=Net(args.net), area3=ProcsList(), ) else: diff --git a/src/tiptop/braille_stream.py b/src/tiptop/braille_stream.py index b7b5e73..a15e23f 100644 --- a/src/tiptop/braille_stream.py +++ b/src/tiptop/braille_stream.py @@ -60,9 +60,10 @@ class BrailleStream: elif value > self.maxval: k = 4 * self.height else: - k = ceil( - (value - self.minval) / (self.maxval - self.minval) * 4 * self.height - ) + diff = self.maxval - self.minval + if diff == 0: + diff = 1 + k = ceil((value - self.minval) / diff * 4 * self.height) # form blocks of 4 blocks = [4] * (k // 4) if k % 4 > 0: |