From 27d3d67a86d2f508ee31cacebff124c0c85c388d Mon Sep 17 00:00:00 2001 From: enkore Date: Mon, 14 Oct 2013 19:15:10 +0200 Subject: [PATCH] Add text module --- README.md | 13 +++++++++++++ i3pystatus/text.py | 23 +++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 i3pystatus/text.py diff --git a/README.md b/README.md index 59f801a..0052fad 100644 --- a/README.md +++ b/README.md @@ -653,6 +653,19 @@ __Settings:__ +### text + + +Display static, colored text. + + +__Settings:__ + +* `text` — (required) +* `color` — HTML color code #RRGGBB (default: `None`) + + + ### weather diff --git a/i3pystatus/text.py b/i3pystatus/text.py new file mode 100644 index 0000000..0996fae --- /dev/null +++ b/i3pystatus/text.py @@ -0,0 +1,23 @@ +from i3pystatus import Module + + +class Text(Module): + + """ + Display static, colored text. + """ + + settings = ( + "text", + ("color", "HTML color code #RRGGBB"), + ) + required = ("text",) + + color = None + + def init(self): + self.output = { + "full_text": self.text + } + if self.color: + self.output["color"] = self.color