Преглед на файлове

sidebar cleanup

tags/v3.1
Luke Smith преди 5 години
родител
ревизия
d10219deb3
No known key found for this signature in database GPG ключ ID: 4C50B54A911F6252
променени са 1 файла, в които са добавени 1 реда и са изтрити 5 реда
  1. +1
    -5
      bin/mw

+ 1
- 5
bin/mw Целия файл

@@ -187,18 +187,14 @@ tryconnect() { mkdir -p "$maildir/$title"
finalize() { \
boxes="$(du -a "$maildir/$title/"* -d 0 | sed "s/^.*\//=/")"
[ -z "$boxes" ] && printf "\033[31mNo local mailboxes have been detected for %s.\033[0m\\nThis means that mbsync has not been successfully run.\\nRun mbsync, and if it has an error, be sure to check your password and server settings manually if needbe.\\n" "$title" && return
printf "Setting up the mutt sidebar...\\n"
sidebar_width="$(sed -n -e '/^set sidebar_width/p' "$muttdir/muttrc" | awk -F'=' '{print $2}')"
delim="$(head -c "$sidebar_width" < /dev/zero | tr '\0' =)"
printf "Setting default mailboxes for your Inbox, Sent, Drafts and Trash in mutt...\\n"
oneline="=$title $delim $(echo "$boxes" | sed -e "s/^\|$/\"/g" | tr "\n" " ")"
spoolfile=$(echo "$boxes" | grep -i -m 1 inbox | sed 's/=/+/g')
record=$(echo "$boxes" | grep -i -m 1 sent | sed 's/=/+/g')
postponed=$(echo "$boxes" | grep -i -m 1 draft | sed 's/=/+/g')
trash=$(echo "$boxes" | grep -i -m 1 trash | sed 's/=/+/g')
sed -i "/^mailboxes\|^set record\|^set postponed\|^set trash\|^set spoolfile/d" "$accdir/$idnum-$title.muttrc"
{ echo "set spoolfile = \"$spoolfile\""; echo "set record = \"$record\""; echo "set postponed = \"$postponed\""; echo "set trash = \"$trash\""; } >> "$accdir/$idnum-$title.muttrc"
echo mailboxes "$oneline" >> "$accdir/$idnum-$title.muttrc"
echo "mailboxes =$title ===================== $(echo "$boxes" | sed -e "s/^\|$/\"/g" | tr "\n" " ")" >> "$accdir/$idnum-$title.muttrc"
printf "Setting up your keyboard shortcuts for jumping between mailboxes...\\n"
sed -i "/# mw-autogenerated/d" "$accdir/$idnum-$title.muttrc"
echo "$boxes" | grep -i -m 1 inbox | formatShortcut i inbox


Зареждане…
Отказ
Запис