From 2016addf81096cd498db2214be05bb18941604bb Mon Sep 17 00:00:00 2001 From: chestm007 Date: Wed, 17 Jul 2019 05:15:23 +1000 Subject: [PATCH] add color support to coin module (#755) * add color support to coin module * remove whitespace --- i3pystatus/coin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/i3pystatus/coin.py b/i3pystatus/coin.py index 9d6d6c0..9974ed2 100644 --- a/i3pystatus/coin.py +++ b/i3pystatus/coin.py @@ -33,6 +33,7 @@ class Coin(IntervalModule): settings = ( ("format", "format string used for output."), + ("color"), ("coin", "cryptocurrency to fetch"), ("decimal", "round coin price down to this decimal place"), ("currency", "fiat currency to show fiscal data"), @@ -42,6 +43,7 @@ class Coin(IntervalModule): ) symbol = "ยค" + color = None format = "{symbol} {price}{status}" coin = "ethereum" currency = "USD" @@ -82,4 +84,7 @@ class Coin(IntervalModule): fdict["price"] = str(round(Decimal(fdict["price"]), self.decimal)) self.data = fdict + self.output = {"full_text": self.format.format(**fdict)} + if self.color is not None: + self.output['color'] = self.color