On Wed, Sep 08, 2021 at 03:47:00PM -0400, Jon LaBadie <mut...@jgcomp.com> wrote:
> On Wed, Sep 08, 2021 at 04:31:11PM +1000, raf wrote: > > On Wed, Sep 08, 2021 at 01:20:27AM -0400, Jon LaBadie <mut...@jgcomp.com> > > wrote: > > > > > I've always preferred a black letters on white background scheme. > > > However, after cataract surgery I'm considering using a dark > > > background scheme. > > > > > > Has anyone a technique for defining multiple color schemes and > > > toggling among them while using mutt? > > > > > > I already keep my color scheme in a separate file and source > > > that file from ~/.muttrc. To extend that, I created two > > > files for light and dark schemes and separate macros (,l and ,d) > > > to source them while running mutt. > > > > > > I'd like to reduce that to a single macro that toggles between > > > the files or one that allows selecting from multiple scheme > > > files, perhaps in round robin fashion. > > > > Someone else will probably give a better answer, but > > here goes. If you have different colour schemes setup > > in different files, you can probably set up a macro in > > your ~/.muttrc that enables the colour scheme you want > > by sourcing the relevant file. e.g. something like: > > > > macro index something :source colour-scheme-1.muttrc\n > > macro index something :source colour-scheme-2.muttrc\n > > > > Where "something" is a key sequence that doesn't > > already do something you care about (e.g. A1, A2). > > That is exactly what I've currently implemented. > > For macro names, I sometimes pick my favorite single letter > and add a leading comma. So my two macros are named ,d (dark) > and ,l (light). > > > Toggling will be more complicated, but doable, if it's really > > needed. It might involve having the macro source a single file, > > and also run an external command that replaces the contents of > > that file with the "other" file. e.g. something like: > > schemes that edit or copy files seem too prone to unanticipated > mess-ups. > > Jon > -- > Jon H. LaBadie j...@labadie.us > 11226 South Shore Rd. (703) 787-0688 (H) > Reston, VA 20190 (703) 935-6720 (C) Yes. Oleg's approach is much better. cheers, raf