首先写一段shell脚本,用于检查gmail的邮箱
- #!/bin/bash
-
#===============================================================================
-
#
-
# FILE: gmail.sh
-
#
-
# USAGE: ./gmail.sh
-
#
-
# DESCRIPTION: 检查gmail,输出到xmobar
-
# a script that show how many new mails you got
-
# to use it in xmobar add this
-
# Run Com "sh" ["/path/to/mail.sh"] "mail" 300
-
#
-
# AUTHOR: BaiLiang , bailiangcn@gmail.com
-
# COMPANY: DQYTV
-
# VERSION: 1.0
-
# CREATED: 2011-03-12 09:31:27
-
# Last Change: 2011年03月13日 21时49分35秒
-
# REVISION: ---
-
#===============================================================================
-
-
gmail_login=""
-
gmail_password=""
-
-
-
dane="$(wget --secure-protocol=auto --timeout=10 -t 3 -q -O - \
-
--user=${gmail_login} --password=${gmail_password} \
-
--no-check-certificate \
-
| grep 'fullcount' \
-
| sed -e 's/.*//;s/<\/fullcount>.*//' 2>/dev/null)"
-
-
if [ -z "${dane}" ]; then
-
echo "";
-
else
-
if [ "${dane}" -gt "0" ]; then
-
echo " ${dane}封新邮件 ";
-
else
-
echo "0";
-
fi
-
fi
再在~/.xmobarrc中增加一句
- Config { font = "xft:WenQuanYi Zen Hei-10"
-
, bgColor = "black"
-
, fgColor = "grey"
-
, position = TopW L 100
-
, lowerOnStart = True
-
, commands = [
-
Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
-
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
-
, Run Memory ["-t","Mem: %"] 10
-
, Run Com "sh" ["/home/bl/bin/gmail.sh"] "mail" 300
-
, Run Swap [] 10
-
, Run Date "%Y年%m月%d日 %H:%M:%S" "date" 10
-
, Run StdinReader
-
]
-
, sepChar = "%"
-
, alignSep = "}{"
-
, template = "%StdinReader% }{ %cpu% %memory% %swap% %eth0% %mail% %date% "
-
}
阅读(1774) | 评论(0) | 转发(0) |