Add urgent flag, use more explanatory default text
@@ -6,7 +6,7 @@ Configuration parameters:
cache_timeout: How often to detect a pending touch request.
(default 1)
format: Display format for the module.
- (default '\?if=is_waiting&color=bad Y')
+ (default '\?if=is_waiting Touch YubiKey')
u2f_keys_path: Full path to u2f_keys if you want to monitor sudo access.
(default '~/.config/Yubico/u2f_keys')
@@ -40,7 +40,7 @@ class Py3status:
"""
# available configuration parameters
cache_timeout = 1
- format = '\?if=is_waiting&color=bad Y'
+ format = '\?if=is_waiting Touch YubiKey'
u2f_keys_path = '~/.config/Yubico/u2f_keys'
def post_config_hook(self):
@@ -98,11 +98,11 @@ class Py3status:
def yubikey(self):
is_waiting = self.pending_gpg or self.pending_sudo
+ format_params = {'is_waiting': is_waiting}
response = {
- 'cached_until':
- self.py3.time_in(self.cache_timeout),
- 'full_text':
- self.py3.safe_format(self.format, {'is_waiting': is_waiting})
+ 'cached_until': self.py3.time_in(self.cache_timeout),
+ 'full_text': self.py3.safe_format(self.format, format_params),
+ 'urgent': is_waiting
}
return response
