summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-04-22 15:46:08 -0400
committerLuke Smith <luke@lukesmith.xyz>2019-04-22 15:46:08 -0400
commitd10219deb37f20124ceecda57b5b8772251d0070 (patch)
tree65b0daa52e8f86aabe5b51632991d9ad6fdd78fa
parent2eceb9fdb85b68a29a2a4e309ca6e7216f34d0ee (diff)
sidebar cleanup
-rwxr-xr-xbin/mw6
1 files changed, 1 insertions, 5 deletions
diff --git a/bin/mw b/bin/mw
index ec861f9..383d85f 100755
--- a/bin/mw
+++ b/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