i3pystatus/i3pystatus/__main__.py.dist
enkore 62b59db8d6 Fixed issue #9
Notmuch checker does not work in this state
NotmuchMailChecker does not work because of a conflict between the notmuch Python API and the file for NotmuchMailChecker which is also named notmuch.

I suggest to rename i3pystatus/notmuch.py to i3pystatus/notmuchchecker.py and modify main.py.dist appropriately.

Reported by mjepronk

Also removed some superfluous whitespace
2013-02-22 18:16:39 +01:00

86 lines
2.0 KiB
Python
Executable File

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from i3pystatus import (
I3statusHandler,
mailchecker,
modsde,
notmuchmail,
thunderbird,
regex,
)
status = I3statusHandler()
# If you want to start i3status automatically with i3pystatus,
# uncomment the following lines
#import subprocess
#process = subprocess.Popen(["i3status", "-c", "~/.i3/status"], stdout=subprocess.PIPE, universal_newlines=True)
#status.file = process.stdout
# Regular expression file watcher
# If you're using a thinkpad, chances are that this displays your fan speed and level
regexsettings = {
"regex": "speed:\s+([0-9]+)\nlevel:\s+([a-zA-Z0-9]+)",
"file": "/proc/acpi/ibm/fan",
"format": "{0} [{1}]",
}
status.register(regex.Regex(regexsettings))
# The imap checker module
mailsettings = {
"color": "#ff0000",
"servers": [
{
"host": "www.testhost1.com",
"port": "993",
"ssl" : True,
"username": "your_username",
"password": "your_password",
"pause": 20
},
{
"host": "www.testhost2.net",
"port": "993",
"ssl" : True,
"username": "your_username",
"password": "your_password",
"pause": 20
}
]
}
mailchecker = mailchecker.MailChecker(mailsettings)
status.register(mailchecker)
# the mods.de forum new bookmarks module
mdesettings = {
"username": "your_username",
"password": "your_password"
}
mde = modsde.ModsDeChecker(mdesettings)
status.register(mde)
# the notmuch mail checker module
db_path = "path_to_your_notmuch_database"
nm = notmuchmail.NotmuchMailChecker(db_path)
status.register(nm)
# the thunderbird dbus new mail checker module
tb = thunderbirdnewmail.ThunderbirdMailChecker()
status.register(tb)
# the battery status checker module
battery = batterychecker.BatteryChecker()
status.register(battery)
# the clock
clock = clock.Clock()
status.register(clock)
# start the handler
status.run()