Merge pull request #167 from Sniffleupagus/patch-3

Add new configuration option "ui.cursor" to enable or disable blinking cursor
This commit is contained in:
Rai
2024-08-19 02:26:24 +10:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@ -151,7 +151,7 @@ personality.throttle_a = 0.4
personality.throttle_d = 0.9 personality.throttle_d = 0.9
ui.invert = false # false = black background, true = white background ui.invert = false # false = black background, true = white background
ui.cursor = true
ui.fps = 0.0 ui.fps = 0.0
ui.font.name = "DejaVuSansMono" # for japanese: fonts-japanese-gothic ui.font.name = "DejaVuSansMono" # for japanese: fonts-japanese-gothic
ui.font.size_offset = 0 # will be added to the font size ui.font.size_offset = 0 # will be added to the font size

View File

@ -216,8 +216,9 @@ class View(object):
delay = 1.0 / self._config['ui']['fps'] delay = 1.0 / self._config['ui']['fps']
while True: while True:
try: try:
name = self._state.get('name') if self._config['ui'].get('cursor', True) == True:
self.set('name', name.rstrip('').strip() if '' in name else (name + '')) name = self._state.get('name')
self.set('name', name.rstrip('').strip() if '' in name else (name + ''))
self.update() self.update()
except Exception as e: except Exception as e:
logging.warning("non fatal error while updating view: %s" % e) logging.warning("non fatal error while updating view: %s" % e)