X-Git-Url: https://vcs.fsf.org/?p=rainbowstream.git;a=blobdiff_plain;f=rainbowstream%2Frainbow.py;h=ed3d07fdf61cb0bb658a9560bf8f4651090ccc3f;hp=00e01eb9e6079175e5ba9c1ba7b315b3e2ee3109;hb=ddb1e61513a7c363b5eb7a12e8fb296077aaaaa0;hpb=4cf86720f0c6834b4af48c577685237f59447937 diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 00e01eb..ed3d07f 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -139,8 +139,8 @@ def get_decorated_name(): files = os.listdir('rainbowstream/colorset') themes = [f.split('.')[0] for f in files if f.split('.')[-1] == 'json'] - themes += ['user'] g['themes'] = themes + db.theme_store(c['theme']) def switch(): @@ -769,19 +769,23 @@ def theme(): """ if not g['stuff']: # List themes - line = ' ' * 2 + light_yellow('* ') for theme in g['themes']: + line = '' # Detect custom config - if theme == 'user': + if theme == 'custom': line += light_magenta('custom') exists = db.theme_query() themes = [t.theme_name for t in exists] - if themes[0] == 'user': + if themes[0] == 'custom': line += light_magenta(' (applied)') else: line += light_magenta(' (not specified)') else: line += light_magenta(theme) + if c['theme'] == theme : + line = ' '*2 + light_yellow('* ') + line + else: + line = ' '*4 + line printNicely(line) else: # Change theme @@ -789,10 +793,11 @@ def theme(): # Load new config new_config = 'rainbowstream/colorset/' + g['stuff'] + '.json' new_config = load_config(new_config) - for nc in new_config: - c[nc] = new_config[nc] + if new_config: + for nc in new_config: + c[nc] = new_config[nc] # Update db - theme_update(g['stuff']) + db.theme_update(g['stuff']) g['decorated_name'] = color_func( c['DECORATED_NAME'])( '[@' + g['original_name'] + ']: ')