Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I would like to do the following:

  • Press a macro combination
  • Enter a script of my own making (Python) which has user interaction (think: UNIX dialog utility for shell scripts)
  • Do some processing based on the dialog response
  • Run some other mutt macro based on the dialog response (e.g. if X, do Y; else do Z)

Is this possible?

share|improve this question

1 Answer 1

Yes, it's possible. The macro to run your script should be done like:

macro index X "<enter-command>source /path/to/your/command|<enter>"

Replacing index and X with the menu name and key that you want to use. Note the | after the command name.

In order to interact with the terminal, the script will need to reopen /dev/tty. The script can then send back to STDOUT muttrc commands to cause other actions. To run a macro you can send back push Y where Y is the key to which the macro is bound.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.