Skip to content

Instantly share code, notes, and snippets.

@creichert
Forked from liangzan/gmail_checker.rb
Created November 1, 2018 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creichert/6bb5dcca2454af5cce32d774e4459c81 to your computer and use it in GitHub Desktop.
Save creichert/6bb5dcca2454af5cce32d774e4459c81 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