Advertisement
metalx1000

Use FZF to Filter and Select Mailbox in NeoMutt

Jun 13th, 2025
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.17 KB | None | 0 0
  1. #!/bin/bash
  2. ######################################################################
  3. #Copyright (C) 2025 Kris Occhipinti
  4. #https://filmsbykris.com
  5. #This program is free software: you can redistribute it and/or modify
  6. #it under the terms of the GNU General Public License as published by
  7. #the Free Software Foundation version 3 of the License.
  8.  
  9. #This program is distributed in the hope that it will be useful,
  10. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. #GNU General Public License for more details.
  13.  
  14. #You should have received a copy of the GNU General Public License
  15. #along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16. ######################################################################
  17. #add this line to your $HOME/.neomuttrc file
  18. #  macro index y ":source /usr/local/bin/mailbox_selector|<enter>"
  19.  
  20. MAILBOX=$((echo "metalx1000";ls ~/.mail/) | fzf --prompt="Select a Mailbox: " --height=100% | sed 's/ /%20/g')
  21.  
  22. if [ -n "$MAILBOX" ]; then
  23.   [[ "$MAILBOX" == "metalx1000" ]] && MAILBOX="/var/mail/metalx1000" || MAILBOX=".mail/$MAILBOX"
  24.   echo "push 'c$MAILBOX<enter>"
  25. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement