From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.213.28.69 with SMTP id l5cs331920ebc; Sun, 17 Jan 2010 10:25:05 -0800 (PST) Received: by 10.224.87.133 with SMTP id w5mr3807910qal.386.1263752705000; Sun, 17 Jan 2010 10:25:05 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 2si3274307qwi.27.2010.01.17.10.25.04; Sun, 17 Jan 2010 10:25:04 -0800 (PST) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 8696B1D788C1; Sun, 17 Jan 2010 13:25:04 -0500 (EST) Received: from mail-qy0-f203.google.com (mail-qy0-f203.google.com [209.85.221.203]) by rubyforge.org (Postfix) with ESMTP id 51DCE18582C7 for ; Sun, 17 Jan 2010 13:20:16 -0500 (EST) Received: by qyk41 with SMTP id 41so4708549qyk.29 for ; Sun, 17 Jan 2010 10:20:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:subject:from:to :in-reply-to:references:date:message-id:user-agent :content-transfer-encoding; bh=F/f61wxbcR75+K2RNaUMVsdo0UCVWfs+SG3iXhqmfK4=; b=sYxkNAKg3XX7xchgxjVASA4F2oKnVohj4b5hHL2mpQTh38CZQK53+SHysE3+2rteQz u+4P+X9R8D9T+twQZbHMIALi/uT5VSbjh5qUtnGQFZvMh5A0jBzBUmSS5ywXs0m5a2Sr PioegSwuxvse5ppq9EDRt/w51TZClWtjxvV2Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:subject:from:to:in-reply-to:references:date:message-id :user-agent:content-transfer-encoding; b=JXuwlj/D2MOkRAmqb3yL2y9nbAuY8KnDIELXrFEsemwx48BBSTTDK79+3tHDRbzpLM E2sBc1M/AhYbQBubmJrTF1Oafpu+/pSiL47h3ALZs36cXxzKJI13ushxWHUy2j7zLYuP T5eMpbFRh8qjdJ+enyQqUSQ5065ZMUrDAxN3I= Received: by 10.224.71.140 with SMTP id h12mr2982988qaj.300.1263752416141; Sun, 17 Jan 2010 10:20:16 -0800 (PST) Received: from localhost (pool-74-106-64-24.spfdma.east.verizon.net [74.106.64.24]) by mx.google.com with ESMTPS id 6sm10242399qwk.31.2010.01.17.10.20.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 17 Jan 2010 10:20:13 -0800 (PST) From: Ben Gamari To: sup-talk In-reply-to: <1263747594-sup-5588@deepthought> References: <1263747594-sup-5588@deepthought> Date: Sun, 17 Jan 2010 13:20:10 -0500 Message-Id: <1263752381-sup-3121@ben-laptop> User-Agent: Sup/git Subject: Re: [sup-talk] Libnotify popups with sup X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org Excerpts from Anirudh Sanjeev's message of Sun Jan 17 12:13:12 -0500 2010: > Hi, > > I want to write a small hook to sup to use libnotify and show a small > popup whenever email comes from specific sources. > You mean something like this? It was a little flaky when I last used it, but it did work. - Ben # libnotify notifications # Requires libnotify-bin package notify_cmd = "/usr/bin/notify-send -i /usr/share/icons/Human?/scalable/emblems/emblem-mail.svg" if num >= 1 notify_summary = "sup found #{num_inbox}/#{num} new message" notify_summary << "s" if num > 1 notify_body = "" from_and_subj.each do |f,s| f.gsub! /\(.*\)/, '' f.gsub! /<.*>/, '' f.strip! s.slice! 0..20 s << "..." notify_body << "M-b~VM-6 #{f} : end if notify_body.length > 100 notify_body.slice! 0..100 notify_body << "\n..." end cmd = "#{notify_cmd} '#{notify_summary}' '#{notify_body}'" Logger.warn cmd system cmd else #system "#{notify_cmd} 'sup status' 'No new email (yet)'" end _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk