clock: allow to specify a custom color and/or to use i3bar default color.
This commit is contained in:
parent
9356b5476a
commit
5c825436f2
@ -351,6 +351,7 @@ This class shows a clock
|
||||
Settings:
|
||||
|
||||
:format: stftime format string, `None` means to use the default, locale-dependent format (default: ``None``)
|
||||
:color: RGB hexadecimal code color specifier, set to `i3Bar` to use i3 bar default (default: ``#ffffff``)
|
||||
:interval: (default: ``1``)
|
||||
|
||||
|
||||
|
@ -16,8 +16,10 @@ class Clock(IntervalModule):
|
||||
|
||||
settings = (
|
||||
("format", "stftime format string, `None` means to use the default, locale-dependent format"),
|
||||
("color", "RGB hexadecimal code color specifier, default to #ffffff, set to `i3Bar` to use i3 bar default"),
|
||||
)
|
||||
format = None
|
||||
color = "#ffffff"
|
||||
interval = 1
|
||||
|
||||
def init(self):
|
||||
@ -37,5 +39,6 @@ class Clock(IntervalModule):
|
||||
self.output = {
|
||||
"full_text": datetime.datetime.now().strftime(self.format),
|
||||
"urgent": False,
|
||||
"color": "#ffffff"
|
||||
}
|
||||
if self.color != "i3Bar":
|
||||
self.output["color"] = self.color
|
||||
|
Loading…
Reference in New Issue
Block a user