Last active
December 19, 2015 22:49
-
-
Save RobertAudi/6030399 to your computer and use it in GitHub Desktop.
Open one iTerm tab per vmail account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you. Feel free to update the wiki with this tip. https://github.com/danchoi/vmail/wiki