[neomutt] Add support for different capitalizations of 'inbox'
This commit is contained in:
parent
66e0cabb7e
commit
832b39ad2d
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
acc_dir="$HOME/.config/neomutt/accounts/"
|
acc_dir="$HOME/.config/neomutt/accounts/"
|
||||||
|
mail_dir="$HOME/mail/"
|
||||||
|
|
||||||
# Select default account
|
# Select default account
|
||||||
default="$(find "$acc_dir" -name "*.mail" -printf "source '%p'\n" -quit)"
|
default="$(find "$acc_dir" -name "*.mail" -printf "source '%p'\n" -quit)"
|
||||||
|
@ -19,9 +20,10 @@ i=1
|
||||||
# Setup folder hooks for all the accounts
|
# Setup folder hooks for all the accounts
|
||||||
for f in "$acc_dir"*.mail; do
|
for f in "$acc_dir"*.mail; do
|
||||||
account="$(basename -s '.mail' "$f")"
|
account="$(basename -s '.mail' "$f")"
|
||||||
|
inbox="$(find "$mail_dir/$account" -maxdepth 1 -iname "inbox" -type d -printf "%f" -quit)"
|
||||||
printf 'folder-hook =%s '\''source %s'\''\n' "$account" "$f"
|
printf 'folder-hook =%s '\''source %s'\''\n' "$account" "$f"
|
||||||
key="$(printf '%s' "$chars" | cut -c "$i")"
|
key="$(printf '%s' "$chars" | cut -c "$i")"
|
||||||
printf 'macro index,pager <Esc>%s "<change-folder>=%s/Inbox<Return>" "Change to %s Inbox"\n' \
|
printf 'macro index,pager <Esc>%s "<change-folder>=%s/%s<Return>" "Change to %s Inbox"\n' \
|
||||||
"$key" "$account" "$account"
|
"$key" "$account" "$inbox" "$account"
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue