mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
Merge 623367092b into 4b19aa47f1
This commit is contained in:
commit
9a59f7ece7
|
|
@ -54,27 +54,30 @@ def get_valid_cwd():
|
||||||
return cwd
|
return cwd
|
||||||
|
|
||||||
|
|
||||||
class Powerline(object):
|
DEFAULT_SYMBOLS = {
|
||||||
symbols = {
|
'compatible': {
|
||||||
'compatible': {
|
'lock': 'RO',
|
||||||
'lock': 'RO',
|
'network': 'SSH',
|
||||||
'network': 'SSH',
|
'separator': u'\u25B6',
|
||||||
'separator': u'\u25B6',
|
'separator_thin': u'\u276F'
|
||||||
'separator_thin': u'\u276F'
|
},
|
||||||
},
|
'patched': {
|
||||||
'patched': {
|
|
||||||
'lock': u'\uE0A2',
|
'lock': u'\uE0A2',
|
||||||
'network': 'SSH',
|
'network': 'SSH',
|
||||||
'separator': u'\uE0B0',
|
'separator': u'\uE0B0',
|
||||||
'separator_thin': u'\uE0B1'
|
'separator_thin': u'\uE0B1'
|
||||||
},
|
},
|
||||||
'flat': {
|
'flat': {
|
||||||
'lock': u'\uE0A2',
|
'lock': u'\uE0A2',
|
||||||
'network': 'SSH',
|
'network': 'SSH',
|
||||||
'separator': '',
|
'separator': '',
|
||||||
'separator_thin': ''
|
'separator_thin': ''
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Powerline(object):
|
||||||
|
|
||||||
|
|
||||||
color_templates = {
|
color_templates = {
|
||||||
'bash': r'\[\e%s\]',
|
'bash': r'\[\e%s\]',
|
||||||
|
|
@ -89,12 +92,16 @@ class Powerline(object):
|
||||||
self.theme = theme
|
self.theme = theme
|
||||||
self.cwd = get_valid_cwd()
|
self.cwd = get_valid_cwd()
|
||||||
mode = config.get("mode", "patched")
|
mode = config.get("mode", "patched")
|
||||||
|
|
||||||
|
template_symbols = getattr(theme, 'SYMBOLS', DEFAULT_SYMBOLS)
|
||||||
|
symbols = template_symbols.get(mode, DEFAULT_SYMBOLS.get(mode, DEFAULT_SYMBOLS['patched']))
|
||||||
|
|
||||||
self.color_template = self.color_templates[args.shell]
|
self.color_template = self.color_templates[args.shell]
|
||||||
self.reset = self.color_template % '[0m'
|
self.reset = self.color_template % '[0m'
|
||||||
self.lock = Powerline.symbols[mode]['lock']
|
self.lock = symbols['lock']
|
||||||
self.network = Powerline.symbols[mode]['network']
|
self.network = symbols['network']
|
||||||
self.separator = Powerline.symbols[mode]['separator']
|
self.separator = symbols['separator']
|
||||||
self.separator_thin = Powerline.symbols[mode]['separator_thin']
|
self.separator_thin = symbols['separator_thin']
|
||||||
self.segments = []
|
self.segments = []
|
||||||
|
|
||||||
def segment_conf(self, seg_name, key, default=None):
|
def segment_conf(self, seg_name, key, default=None):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue