timewarrior: add :02d for minutes and seconds
@@ -23,7 +23,7 @@ Configuration parameters:
(default '[Timew {format_time}]|No Timew')
format_datetime: specify strftime characters to format (default {})
format_duration: display format for time duration
- (default '\?not_zero [{days}d ][{hours}:]{minutes:02d}:{seconds:02d}')
+ (default '\?not_zero [{days}d ][{hours}:]{minutes}:{seconds}')
format_tag: display format for tags (default '\?color=state_tag {name}')
format_tag_separator: show separator if more than one (default ' ')
format_time: display format for tracked times
@@ -181,7 +181,7 @@ class Py3status:
filter = None
format = '[Timew {format_time}]|No Timew'
format_datetime = {}
- format_duration = '\?not_zero [{days}d ][{hours}:]{minutes:02d}:{seconds:02d}'
+ format_duration = '\?not_zero [{days}d ][{hours}:]{minutes}:{seconds}'
format_tag = '\?color=state_tag {name}'
format_tag_separator = ' '
format_time = '[\?color=state_time [{format_tag} ]{format_duration}]'
@@ -191,6 +191,19 @@ class Py3status:
'state_time': [(0, 'darkgray'), (1, 'degraded')],
}
+ class Meta:
+ update_config = {
+ 'update_placeholder_format': [
+ {
+ 'placeholder_formats': {
+ 'minutes': ':02d',
+ 'seconds': ':02d',
+ },
+ 'format_strings': ['format_duration'],
+ }
+ ],
+ }
+
def post_config_hook(self):
if not self.py3.check_commands('timew'):
raise Exception(STRING_NOT_INSTALLED)
