Skip to content

Instantly share code, notes, and snippets.

@RobertAudi
Last active December 19, 2015 22:49
Show Gist options
  • Save RobertAudi/6030399 to your computer and use it in GitHub Desktop.
Save RobertAudi/6030399 to your computer and use it in GitHub Desktop.
Open one iTerm tab per vmail account
mail() {
local option=""
if [[ ! -z "$2" ]]; then
option=$2
fi
if [[ $1 = "account1" ]]; then
VMAIL_HOME=~/.vmail/account1 vmail $option
elif [[ $1 = "account2" ]]; then
VMAIL_HOME=~/.vmail/account2 vmail $option
elif [[ $1 = "account3" ]]; then
VMAIL_HOME=~/.vmail/account3 vmail $option
else
echo "Please specify an account."
fi
}
vm() {
[ `uname -s` != "Darwin" ] && return
for account in "account1" "account2" "account3" ; do
osascript &>/dev/null <<EOF
tell application "iTerm"
tell current terminal
launch session "Default"
tell the last session
write text "echo -ne \"\\\\e]1;$account\\\\a\""
write text "mail $account"
end tell
end tell
end tell
EOF
done
}
@danchoi
Copy link

danchoi commented Jul 18, 2013

Thank you. Feel free to update the wiki with this tip. https://github.com/danchoi/vmail/wiki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment