lemonbar: Attempt to restart i3ws connection 5 times with increasing delay

This commit is contained in:
2020-02-01 22:01:13 +01:00
parent 4d8e0d1f97
commit b09891fd04
2 changed files with 18 additions and 4 deletions

View File

@@ -414,7 +414,10 @@ class i3Module(LemonModule):
common.logger.info('Started module {}'.format(self.__class__.__name__))
common.health_logger.info('Module {} up'.format(self.__class__.__name__))
self.i3_ws_obj.work() # This is a blocking command
try:
self.i3_ws_obj.work() # This is a blocking command
except ConnectionError:
common.logger.info('i3ws failed connecting to i3 socket')
common.logger.info('Reached end of module {}'.format(self.__class__.__name__))
common.health_logger.info('Module {} down'.format(self.__class__.__name__))
@@ -533,7 +536,7 @@ class i3Module(LemonModule):
else:
new_km = self.def_keymap
common.logger.debug('Setting default keymap {} for {}'.format(new_km, wclass))
subprocess.call(['/home/kuba/.i3/scripts/lang.sh', 'qset', new_km])
subprocess.call(['/home/kuba/.i3/scripts/lang.sh', 'qset', new_km]) # TODO it is this script that writes to fifo, triggering the formatting
def i3msg_comm(self, *cmd):
self.i3_ws_obj.command(' '.join(cmd))