You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
752 B

  1. #!/bin/sh
  2. echo "Specify account:"
  3. read -r acc
  4. acc_spec=$(ls ~/.config/mutt/accounts/ | grep "$acc")
  5. echo "Specify folder:"
  6. read -r folder
  7. echo "$folder"
  8. mkdir -p ~/.local/share/mail/"$acc"/"$folder"/new
  9. mkdir -p ~/.local/share/mail/"$acc"/"$folder"/tmp
  10. mkdir -p ~/.local/share/mail/"$acc"/"$folder"/cur
  11. sed -i "/^mailboxes/ s/$/ \"="$folder"\"/" ~/.config/mutt/accounts/"$acc_spec"
  12. echo "Folder created, do you want to add a shortcut?"
  13. read -r shortcut
  14. if [ "$shortcut" = "y" ]
  15. then
  16. echo "Specify Shortcut:"
  17. read -r key
  18. cat <<EOF >> ~/.config/mutt/accounts/"$acc_spec"
  19. #
  20. macro index,pager g$key "<change-folder>=$folder<enter>" "go to $folder"
  21. macro index,pager M$key "<save-message>=$folder<enter>" "go to $folder"
  22. EOF
  23. echo "Shortcut created!"
  24. fi