forked from colonelpanic/dotfiles
mu4e sync and make EDITOR work again.
This commit is contained in:
parent
7cb2140686
commit
c7c9fc6069
3
dotfiles/lib/mu4e_sync.sh
Executable file
3
dotfiles/lib/mu4e_sync.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env zsh
|
||||
refresh_config
|
||||
update_mail
|
@ -77,7 +77,7 @@ function time_emacs {
|
||||
}
|
||||
|
||||
# Make emacs the default editor.
|
||||
export EDITOR='emacs_open'
|
||||
export EDITOR="e() { zsh -c 'emacs_open '"'"$@"; return 0; }; e'
|
||||
export VISUAL="$EDITOR"
|
||||
# This is ugly as sin but I can't figure out how else to do it.
|
||||
export GIT_EDITOR="zsh -c 'emacs_open '"'"$@"; return 0'
|
||||
|
28
dotfiles/lib/shellrc/mu4e.sh
Normal file
28
dotfiles/lib/shellrc/mu4e.sh
Normal file
@ -0,0 +1,28 @@
|
||||
MAILDIR="$HOME/Mail"
|
||||
DBUS_COOKIE="$HOME/.sauron-dbus"
|
||||
|
||||
function sauron_msg {
|
||||
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
|
||||
echo "DBUS session not found."
|
||||
if test -e $DBUS_COOKIE; then
|
||||
export DBUS_SESSION_BUS_ADDRESS="`cat $DBUS_COOKIE`"
|
||||
else
|
||||
echo "DBUS cookie not found, unable to send message"
|
||||
fi
|
||||
fi
|
||||
if test -n "$DBUS_SESSION_BUS_ADDRESS"; then
|
||||
dbus-send --session \
|
||||
--dest="org.gnu.Emacs" \
|
||||
--type=method_call \
|
||||
"/org/gnu/Emacs/Sauron" \
|
||||
"org.gnu.Emacs.Sauron.AddMsgEvent" \
|
||||
string:"$1" uint32:3 string:"$2"
|
||||
fi
|
||||
}
|
||||
|
||||
function update_mail {
|
||||
offlineimap
|
||||
for f in `find "$MAILDIR/INBOX/" -mmin -5 -a -type f`; do
|
||||
sauron_msg "Gmail" "$(mu view $f | grep -B 10 Date)"
|
||||
done
|
||||
}
|
Loading…
Reference in New Issue
Block a user