Skip to content

Instantly share code, notes, and snippets.

@manolomartinez
Last active January 25, 2022 10:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save manolomartinez/7082024 to your computer and use it in GitHub Desktop.
Save manolomartinez/7082024 to your computer and use it in GitHub Desktop.
Use ranger to save attachments in mutt.
# use ranger to save attachment
macro attach S "<pipe-message>/path/to/muttsaveattach.sh"<enter>
#!/bin/sh
urxvt -e ranger --choosefile=/tmp/muttattach
cat > $"`cat /tmp/muttattach`"
@manolomartinez
Copy link
Author

manolomartinez commented Oct 21, 2013

Add the .muttrc line to, well, your .muttrc. Then pressing "S" in the attachment menu will bring up a ranger instance. In ranger, navigate to the directory where you want to save your file and :touch <nameoftheattachment>, select the file you've just touched, press enter and mutt will save the attachment to that file.

@Amooti73
Copy link

This script wouldn't work for me until I edited muttsaveattach.sh by removing $ from line 3. After this edit it works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment