You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# version 0.2: remove the imap "client" buffer, just do the unread count
# 2009-06-18, xt <xt@bash.no>
# version 0.1: initial release.
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
'''
Usage: put [imap] in your status bar items. (Or any other bar to your liking)
"/set weechat.bar.status.items".
Warning: If you have a slow imap server, weechat might "freeze" while doing operations against remove server as this script does not do any background processing and weechat is single threaded.
'''
importweechatasw
importimaplibasi
fromtimeimporttimeasnow
importre
SCRIPT_NAME="imap_status"
SCRIPT_AUTHOR="xt <xt@bash.no>"
SCRIPT_VERSION="0.7"
SCRIPT_LICENSE="GPL3"
SCRIPT_DESC="Bar item with unread imap messages count"
LAST_RUN=0
LAST_MESSAGE=''
# script options
settings= {
"username" : '',
"password" : '',
"hostname" : '', # gmail uses imap.gmail.com
"port" : '993',
'mailboxes' : 'INBOX', #comma separated list of mailboxes. "Inbox" works fine too with gmail.
'message' : 'Mail: ',
'message_color' : 'default',
'count_color' : 'default',
'interval' : '5',
}
classImap(object):
''' Simple helper class for interfacing with IMAP server '''