From e6357f4c90ba6b218cb5a4d4e6126827c08736e9 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 22 Apr 2017 08:26:28 +0200 Subject: [PATCH] [modules/traffic] Add alignment and minimum width Set the minimum width for uplink and downlink widgets to "down 1000MB", which should be plenty, and change alignment to right (personally, I find this looks nicer). To not have the icons on the left side "jump around" depending on the value, make them suffixes. If this solution is not sufficient, alternatively, the widget itself could perform value padding. In that case, the whole alignment and min-width settings would be obsolete and the icons could remain on the left side. --- bumblebee/modules/traffic.py | 4 ++++ themes/icons/ascii.json | 4 ++-- themes/icons/awesome-fonts.json | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bumblebee/modules/traffic.py b/bumblebee/modules/traffic.py index b7a0b39..d1d4c0f 100644 --- a/bumblebee/modules/traffic.py +++ b/bumblebee/modules/traffic.py @@ -54,9 +54,13 @@ class Module(bumblebee.engine.Module): widget_tx = self.widget(txname) if not widget_rx: widget_rx = bumblebee.output.Widget(name=rxname) + widget_rx.set("theme-minwidth", "down 1000MB") + widget_rx.set("theme-align", "right") widgets.append(widget_rx) if not widget_tx: widget_tx = bumblebee.output.Widget(name=txname) + widget_tx.set("theme-minwidth", "down 1000MB") + widget_tx.set("theme-align", "right") widgets.append(widget_tx) prev_rx = widget_rx.get("rx", 0) diff --git a/themes/icons/ascii.json b/themes/icons/ascii.json index 5d4b916..cc34773 100644 --- a/themes/icons/ascii.json +++ b/themes/icons/ascii.json @@ -64,7 +64,7 @@ "prefix": "sensors" }, "traffic": { - "rx": { "prefix": "down"}, - "tx": {"prefix": "up"} + "rx": { "suffix": "down"}, + "tx": {"suffix": "up"} } } diff --git a/themes/icons/awesome-fonts.json b/themes/icons/awesome-fonts.json index 4263a19..5358b04 100644 --- a/themes/icons/awesome-fonts.json +++ b/themes/icons/awesome-fonts.json @@ -80,7 +80,7 @@ "prefix": "🌡" }, "traffic":{ - "rx": { "prefix": "" }, - "tx": { "prefix": "" } + "rx": { "suffix": "" }, + "tx": { "suffix": "" } } }