On Mon, Dec 05, 2022 at 08:26:16PM -0500, Jon LaBadie wrote:

> Perhaps I've overlooked the facility.  Is there a way to test the
> shell environment in .muttrc?  Basically an "if" statement.
> 
> I enter mutt in several ways (direct, aliases, shell scripts,
> functions, etc) and from several devices.  My smart phone needs a
> different color scheme than the other devices.

I think there may be an internal way as well, but one option would be to
set an env var (e.g., TYPE) depending on the type of session, and then
do something like (untested):

source ~/.mutt/colors.${TYPE:-default}

Or you could key it on hostname, similar to this example:
https://lwn.net/Articles/587348/

You can also source a shell script to do some stuff
https://mutt-users.mutt.narkive.com/WovuIH31/conditionally-include-a-file-in-the-configuration

there may be some patches to support more within the config itself.
neomutt (which I don't use personally) has some support via this hook:
https://neomutt.org/feature/ifdef


Reply via email to