comparison sat_frontends/jp/base.py @ 3051:ee2654308a57

jp: default to "dark" if background is not set and can't be detected
author Goffi <goffi@goffi.org>
date Thu, 03 Oct 2019 22:17:19 +0200
parents 9839ce068140
children 9d0df638c8b4
comparison
equal deleted inserted replaced
3050:d2a26ec74b31 3051:ee2654308a57
129 sys.stdout.flush() 129 sys.stdout.flush()
130 expected = "\033]11;rgb:" 130 expected = "\033]11;rgb:"
131 for c in expected: 131 for c in expected:
132 ch = sys.stdin.read(1) 132 ch = sys.stdin.read(1)
133 if ch != c: 133 if ch != c:
134 # background id is not supported 134 # background id is not supported, we default to "dark"
135 # TODO: log something? 135 # TODO: log something?
136 return 136 return 'dark'
137 red, green, blue = [int(c, 16)/65535 for c in sys.stdin.read(14).split('/')] 137 red, green, blue = [int(c, 16)/65535 for c in sys.stdin.read(14).split('/')]
138 # '\a' is the last character 138 # '\a' is the last character
139 sys.stdin.read(1) 139 sys.stdin.read(1)
140 finally: 140 finally:
141 termios.tcsetattr(stdin_fd, termios.TCSADRAIN, old_settings) 141 termios.tcsetattr(stdin_fd, termios.TCSADRAIN, old_settings)