瀏覽代碼

Added Script addfolder to bin/

pull/349/head
Mr Chainman 5 年之前
父節點
當前提交
bf94129160
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 3A782BCA8E54519F
共有 1 個檔案被更改,包括 24 行新增0 行删除
  1. +24
    -0
      bin/addfolder

+ 24
- 0
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 <<EOF >> ~/.config/mutt/accounts/"$acc_spec"
#
macro index,pager g$key "<change-folder>=$folder<enter>" "go to $folder"
macro index,pager M$key "<save-message>=$folder<enter>" "go to $folder"
EOF
echo "Shortcut created!"
fi

Loading…
取消
儲存