From 8d80b375a30d7530ce5c52554c3577f9694c240e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Mand=C3=A1k?= Date: Sat, 6 Jun 2015 14:15:48 +0200 Subject: [PATCH] Module: Added `hints` setting that allows the user to add additional i3bar protocol blocks to module's output. --- i3pystatus/core/modules.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/i3pystatus/core/modules.py b/i3pystatus/core/modules.py index 9a848a2..946dbae 100644 --- a/i3pystatus/core/modules.py +++ b/i3pystatus/core/modules.py @@ -13,6 +13,7 @@ class Module(SettingsBase): ('on_rightclick', "Callback called on right click (string)"), ('on_upscroll', "Callback called on scrolling up (string)"), ('on_downscroll', "Callback called on scrolling down (string)"), + ('hints', "Additional hints for module. TODO"), ) on_leftclick = None @@ -20,6 +21,12 @@ class Module(SettingsBase): on_upscroll = None on_downscroll = None + hints = None + """ + TODO + `min_width`, `align`, `separator`, `separator_block_width` + """ + def registered(self, status_handler): """Called when this module is registered with a status handler""" @@ -30,6 +37,9 @@ class Module(SettingsBase): self.output["instance"] = str(id(self)) if (self.output.get("color", "") or "").lower() == "#ffffff": del self.output["color"] + if self.hints: + h = {i: self.hints[i] for i in self.hints if i not in self.output} + self.output.update(h) json.insert(convert_position(self.position, json), self.output) def run(self):