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:
|
Settings:
|
||||||
|
|
||||||
:format: stftime format string, `None` means to use the default, locale-dependent format (default: ``None``)
|
: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``)
|
:interval: (default: ``1``)
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,8 +16,10 @@ class Clock(IntervalModule):
|
|||||||
|
|
||||||
settings = (
|
settings = (
|
||||||
("format", "stftime format string, `None` means to use the default, locale-dependent format"),
|
("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
|
format = None
|
||||||
|
color = "#ffffff"
|
||||||
interval = 1
|
interval = 1
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
@ -37,5 +39,6 @@ class Clock(IntervalModule):
|
|||||||
self.output = {
|
self.output = {
|
||||||
"full_text": datetime.datetime.now().strftime(self.format),
|
"full_text": datetime.datetime.now().strftime(self.format),
|
||||||
"urgent": False,
|
"urgent": False,
|
||||||
"color": "#ffffff"
|
|
||||||
}
|
}
|
||||||
|
if self.color != "i3Bar":
|
||||||
|
self.output["color"] = self.color
|
||||||
|
Loading…
Reference in New Issue
Block a user