From d6d76f3a5872b2f0a49c84a422a16c4033c5bc7d Mon Sep 17 00:00:00 2001 From: Mr Chainman Date: Wed, 1 Jan 2020 17:57:06 +0100 Subject: [PATCH] Added comments to addfolder --- bin/addfolder | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/addfolder b/bin/addfolder index 1b7d031..79cfe09 100755 --- a/bin/addfolder +++ b/bin/addfolder @@ -1,20 +1,29 @@ #!/bin/sh echo "Specify account:" +# The account to put the folder in read -r acc +# get the full path acc_spec=$(ls ~/.config/mutt/accounts/ | grep "$acc") echo "Specify folder:" +# Ask for the foldername read -r folder +# Echo back foldername (for informational purpose) echo "$folder" +# Create needed directories mkdir -p ~/.local/share/mail/"$acc"/"$folder"/new mkdir -p ~/.local/share/mail/"$acc"/"$folder"/tmp mkdir -p ~/.local/share/mail/"$acc"/"$folder"/cur +# Add the folder to muttrc sed -i "/^mailboxes/ s/$/ \"="$folder"\"/" ~/.config/mutt/accounts/"$acc_spec" +# Ask if a shortcut is needed echo "Folder created, do you want to add a shortcut?" read -r shortcut +# If yes, then ask for the shortcutkey (without prefix) if [ "$shortcut" = "y" ] then echo "Specify Shortcut:" read -r key + # Add shortcuts to muttrc cat <> ~/.config/mutt/accounts/"$acc_spec" # macro index,pager g$key "=$folder" "go to $folder"