diff options
-rwxr-xr-x | alot/init.py | 2 | ||||
-rw-r--r-- | alot/settings.py | 41 | ||||
-rw-r--r-- | data/example.full.rc | 6 | ||||
-rw-r--r-- | data/example.rc | 2 | ||||
-rw-r--r-- | data/example_hooks.py | 5 |
5 files changed, 21 insertions, 35 deletions
diff --git a/alot/init.py b/alot/init.py index c23fee93..689e677d 100755 --- a/alot/init.py +++ b/alot/init.py @@ -34,7 +34,7 @@ def parse_args(): help='config file') parser.add_argument('-C', dest='colours', type=int, - choices=[1, 16, 88, 256], + choices=[1, 16, 256], help='colour mode') parser.add_argument('-r', dest='read_only', action='store_true', diff --git a/alot/settings.py b/alot/settings.py index 85d62352..ad4bf4bb 100644 --- a/alot/settings.py +++ b/alot/settings.py @@ -39,7 +39,7 @@ DEFAULTS = { 'hooksfile': '~/.alot.py', 'bug_on_exit': 'False', }, - 'normal-theme': { + '16c-theme': { 'bufferlist_focus_bg': 'dark gray', 'bufferlist_focus_fg': 'white', 'bufferlist_results_even_bg': 'black', @@ -105,7 +105,7 @@ DEFAULTS = { 'threadline_tags_focus_bg': 'dark cyan', 'threadline_tags_focus_fg': 'yellow,bold', }, - 'mono-theme': { + '1c-theme': { 'bufferlist_focus': 'standout', 'bufferlist_results_even': 'default', 'bufferlist_results_odd': 'default', @@ -139,7 +139,7 @@ DEFAULTS = { 'threadline_tags': 'bold', 'threadline_tags_focus': 'standout', }, - 'highcolour-theme': { + '256c-theme': { 'bufferlist_focus_bg': 'g38', 'bufferlist_focus_fg': '#ffa', 'bufferlist_results_even_bg': 'g3', @@ -306,33 +306,24 @@ class CustomConfigParser(SafeConfigParser): except: pass - def get_modestring(self): - mode = self.getint('general', 'colourmode') - if mode == 2: - return 'mono-theme' - elif mode == 16: - return 'normal-theme' - else: - return 'highcolour-theme' - def get_palette(self): mode = self.getint('general', 'colourmode') - ms = self.get_modestring() + ms = "%dc-theme" % mode names = self.options(ms) + DEFAULTS[ms].keys() if mode > 2: names = set([s[:-3] for s in names]) p = list() for attr in names: - nf = self.get('normal-theme', attr + '_fg', fallback='default') - nb = self.get('normal-theme', attr + '_bg', fallback='default') - m = self.get('mono-theme', attr, fallback='default') - hf = self.get('highcolour-theme', attr + '_fg', fallback='default') - hb = self.get('highcolour-theme', attr + '_bg', fallback='default') + nf = self.get('16c-theme', attr + '_fg', fallback='default') + nb = self.get('16c-theme', attr + '_bg', fallback='default') + m = self.get('1c-theme', attr, fallback='default') + hf = self.get('256c-theme', attr + '_fg', fallback='default') + hb = self.get('256c-theme', attr + '_bg', fallback='default') p.append((attr, nf, nb, m, hf, hb)) if attr.startswith('tag_') and attr + '_focus' not in names: - nb = self.get('normal-theme', 'threadline_focus_bg', + nb = self.get('16c-theme', 'threadline_focus_bg', fallback='default') - hb = self.get('highcolour-theme', 'threadline_focus_bg', + hb = self.get('256c-theme', 'threadline_focus_bg', fallback='default') p.append((attr + '_focus', nf, nb, m, hf, hb)) return p @@ -341,19 +332,19 @@ class CustomConfigParser(SafeConfigParser): mode = self.getint('general', 'colourmode') base = 'tag_%s' % tag if mode == 2: - if self.get('mono-theme', base): + if self.get('1c-theme', base): return 'tag_%s' % tag elif mode == 16: - has_fg = self.get('normal-theme', base + '_fg') - has_bg = self.get('normal-theme', base + '_bg') + has_fg = self.get('16c-theme', base + '_fg') + has_bg = self.get('16c-theme', base + '_bg') if has_fg or has_bg: if focus: return base + '_focus' else: return base else: # highcolour - has_fg = self.get('highcolour-theme', base + '_fg') - has_bg = self.get('highcolour-theme', base + '_bg') + has_fg = self.get('256c-theme', base + '_fg') + has_bg = self.get('256c-theme', base + '_bg') if has_fg or has_bg: if focus: return base + '_focus' diff --git a/data/example.full.rc b/data/example.full.rc index 85b2934a..f6ebb1ef 100644 --- a/data/example.full.rc +++ b/data/example.full.rc @@ -79,7 +79,7 @@ ls = bufferlist quit = exit -[normal-theme] +[16c-theme] bufferlist_focus_bg = dark gray bufferlist_focus_fg = white bufferlist_results_even_bg = black @@ -145,7 +145,7 @@ threadline_tags_fg = brown threadline_tags_focus_bg = dark cyan threadline_tags_focus_fg = yellow,bold -[highcolour-theme] +[256c-theme] bufferlist_focus_bg = g38 bufferlist_focus_fg = #ffa bufferlist_results_even_bg = g3 @@ -211,7 +211,7 @@ threadline_tags_fg = #a86 threadline_tags_focus_bg = g58 threadline_tags_focus_fg = #ff8 -[mono-theme] +[1c-theme] bufferlist_focus = standout bufferlist_results_even = default bufferlist_results_odd = default diff --git a/data/example.rc b/data/example.rc index 18ecc7a9..04b383db 100644 --- a/data/example.rc +++ b/data/example.rc @@ -28,7 +28,7 @@ t = toggletag todo [tag translate] flagged = ⚑ -[highcolour-theme] +[256c-theme] tag_todo_bg = #d66 tag_todo_fg = white tag_killed_bg = g66 diff --git a/data/example_hooks.py b/data/example_hooks.py deleted file mode 100644 index 1c1e0e9d..00000000 --- a/data/example_hooks.py +++ /dev/null @@ -1,5 +0,0 @@ -# hooks get two parameters, an alot.ui.UI object, and an alt.db.DBManager object -# for all commands X, pre_X gets called before, post_X after X is applied. - -def pre_exit(ui, dbman): - ui.logger.info('goodbye!') |