multiple color schemes
Oleg A. Mamontov
oleg at mamontov.net
Wed Sep 8 23:15:51 UTC 2021
On Wed, Sep 08, 2021 at 03:50:23PM -0400, Jon LaBadie wrote:
>On Wed, Sep 08, 2021 at 04:23:59PM +0300, Oleg A. Mamontov wrote:
>>On Wed, Sep 08, 2021 at 01:20:27AM -0400, Jon LaBadie 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.
>>
>>You can try something like below approach with dynamically redefined
>>macro:
>>
>>~/.muttrc
>>---
>>macro index XX source ~/.mutt/colors1.muttrc
>>---
>>
>>~/.mutt/colors1.muttrc
>>---
>># colors #1
>>macro index XX source ~/.mutt/colors2.muttrc
>>---
>>
>>~/.mutt/colors2.muttrc
>>---
>># colors #2
>>macro index XX source ~/.mutt/colors1.muttrc
>>---
>
>Interesting approach.
>
>Some interpreted languages prevent the redefinition
>of a macro while that macro is executing. Not sure
>about mutt's interpreter, I'll have to check.
While I believe mutt isn't the case, you can use similar approach but
with variables only:
~/.muttrc
---
set my_colors = '2';
macro index AA ':source ~/.mutt/colors.$my_colors.muttrc<enter>'
---
~/.mutt/colors.1.muttrc
---
# colors #1
set my_colors = '2';
---
~/.mutt/colors.2.muttrc
---
# colors #2
set my_colors = '1';
---
Just tested it successfuly. Hope this helps.
>thanks,
>
>--
>Jon H. LaBadie mutter at jgcomp.com
> 11226 South Shore Rd. (703) 787-0688 (H)
> Reston, VA 20190 (703) 935-6720 (C)
--
Cheers,
Oleg A. Mamontov
mailto: oleg at mamontov.net
skype: lonerr11
cell: +7 (903) 798-1352
More information about the Mutt-users
mailing list