Skip to content

Instantly share code, notes, and snippets.

@liangzan
Created January 19, 2012 23:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save liangzan/1643664 to your computer and use it in GitHub Desktop.
Save liangzan/1643664 to your computer and use it in GitHub Desktop.
Gmail checker for Xmobar
# Gmail checker for Xmobar
#
# Install the ruby-gmail and mime gem to system
# Put the script under ~/path/to/gmail_checker.rb
# Make sure it is executable
require 'gmail'
gmail = Gmail.new('example@gmail.com', 'password')
mail_count = gmail.inbox.count(:unread)
puts mail_count == 0 ? "No mail" : "Mail: #{mail_count}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment