Extract repeat and retry commands

https://github.com/justincampbell/repeat-and-retry
Reset left bg when resetting