From bf94129160c9f1e9ca3e51152421ee9521433e1f Mon Sep 17 00:00:00 2001 From: Mr Chainman Date: Wed, 1 Jan 2020 17:53:45 +0100 Subject: [PATCH] Added Script addfolder to bin/ --- bin/addfolder | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 bin/addfolder diff --git a/bin/addfolder b/bin/addfolder new file mode 100755 index 0000000..1b7d031 --- /dev/null +++ b/bin/addfolder @@ -0,0 +1,24 @@ +#!/bin/sh +echo "Specify account:" +read -r acc +acc_spec=$(ls ~/.config/mutt/accounts/ | grep "$acc") +echo "Specify folder:" +read -r folder +echo "$folder" +mkdir -p ~/.local/share/mail/"$acc"/"$folder"/new +mkdir -p ~/.local/share/mail/"$acc"/"$folder"/tmp +mkdir -p ~/.local/share/mail/"$acc"/"$folder"/cur +sed -i "/^mailboxes/ s/$/ \"="$folder"\"/" ~/.config/mutt/accounts/"$acc_spec" +echo "Folder created, do you want to add a shortcut?" +read -r shortcut +if [ "$shortcut" = "y" ] +then + echo "Specify Shortcut:" + read -r key + cat <> ~/.config/mutt/accounts/"$acc_spec" +# +macro index,pager g$key "=$folder" "go to $folder" +macro index,pager M$key "=$folder" "go to $folder" +EOF + echo "Shortcut created!" +fi