
Aero AIO: Kmail based mail notification
Source (link to git-repo or to original if based on someone elses unmodified work):
REQUIRES: >= Aero AIO 0.8e and >= KDE 3.5.0
OPTIONAL: kttsd, latest PyKDE
FEATURES:
- Uses KMail to check for mail, hence supports all the account types that KMail does (POP, IMAP, Local, etc.) and there's no need to supply it with a password!
- Shows unread messages in each of a user-specified set of folders in KMail. This is very useful if your mail is sorted automatically into folders or you've associated different accounts with different folders
- Uses KDEs Text-to-speech engine (kttsd) to tell you when you have new messages. This behavior can be turned off
- Has a configurable Silent Zone, i.e. a period of time when the speech is automatically turned off. I dislike being woken up for email.
- Clicking the folder names opens KMail at that folder
- Can also display unread mails from your IMAP folders. This feature is new in 2.0.0 and FRAGILE (see Caveats)
USAGE:
- Install the .aiz plugin using the Aero AIO config dialog. Note due to a bug in Aero AIO, you may need to run the command mkdir -p ~/.aero_aio/sounds/kmail in a terminal before trying to install the plugin.
- The plugin can be added via the Configuration menu, it is named KMail
- The first time you run the theme, you may get a kded notification asking whether you want to allow access to the kdewallet for superkaramba (or anonymous is you don't have PyKDE). If you click Deny Always, the message list feature wont work, if you click Allow Always, it might work, but you should be aware that you have granted access to all your passwords to any superkaramba theme running on your computer. Clicking Allow Always for anonymous is not a good idea if your kdewallet stores sensitive passwords/data.
- The parrot icon in the bottom left corner toggles the speech on/off. To permanently turn off speech, use the config dialog. You can also automatically have the speech turned off for a fixed period of time everyday (the Silent Zone) via the config dialog. The icon is hidden in the Silent Zone or if you disable speech
- Clicking the envelope icon causes kmail to check for new mail and then updates the theme
- Click the message list button to see a list of unread mails in each of your monitored IMAP folders.
CAVEATS:
- It needs KMail running in the background
- The speech engine needs kttsd properly configured and running in the background. If you don't have kttsd it will just say that you have new mail, not how many messages. You need to setup KDE Notifications to be able to play ogg files. arts works, if you're using an external player play from the sox package works well
- If KMail is running in kontact the code to open it on the clicked folder only works if the default accelerator for KMail is unchanged. The code is
dcop kontact kontact-mainwindow#1 activateAction CTRL+2. If anyone knows of a better way to do this, please let me know
- The Message list feature:
This only works for folders in an IMAP account. Unfortunately the KDE devs weren't able to implement the getMessages dcop calls for kmail, so I had to write a tiny IMAP client within the theme to fetch message headers from the server itself. The IMAP client only opens folders in read mode, so it wont mess with your email, but it is a highly non-trivial feature, so I don't expect it to work out of the box for everyone. If you have trouble, set DEBUG=True in ~/.aero_aio/kmail_aio.py, run SK in a terminal and post the output. Your account details are read in from kmailrc, which is another point of fragility, since I'm no expert on KDE rc files. Not having a working PyKDE installation makes this feature less likely to work.
The rest of the plugin should still work, independent of the message list. If you want to disable it completely, just click 'Deny Always' when it asks for access to the kde wallet. I've also added a link to the last stable version, if 2.0.0+ breaks for you.
TODO:
- Support for unlimited folders (only display those with > 0 msgs and make the view scrollable, like the masseage pane). This means I have to write a viewport class, a list class and a scroll bar class if I want it done right
- Switch message list backend to using KMail messageRefs dcop call when (probably for KDE 4.0) the KDE devs add it to FolderIface
ver 2.2.1
- Fixed handling of non-ascii characters in kmailrc
ver 2.2.0
- Coded a workaround so that the message view function works without PyKDE.
ver 2.1.4
- Fixed a bug in the detection of PyKDE.
ver 2.1.3
- Moved resources into kmail sub-folders to keep ~/.aero-aio neater
ver 2.1.2
- Moved to the .aiz Aero AIO plugin format and removed stable version since I haven't got any bug reports on the 2.x series
ver 2.1.1
- Fixed typo in config dialog that would prevent it from saving changes
ver 2.1.0
- Added a configurable emphasis color (see screenshots)
- Fixed a bug with th scrollbar being rendered in the folder view as well as the message view
ver 2.0.1
- Fixed a typo that was preventing the message list from displaying
- Handled a rare error condition, caused by removing a kmail account that contains monitored folders
version 2.0.0
- Added a message view function, where the theme shows you a list of your unread messages. This feature is FRAGILE (see caveats)
- Cleaned up the folder handling code (gotta love oop)
version 1.3.3
- Moved the mail count onto the envelop icon as in the original mail theme by adrienV
- Removed deprecated calls to rstrip and replace by re.sub
version 1.3.2
- Changed the position of the mail icon
- Code cleanups...gotta love iterators
version 1.3.1
- changed to use unreadRecursiveMessages, so it should show the number of unread msgs in all subfolders as well
version 1.3.0
- Added a configurable Silent Zone (a period of time when the speech is automatically turned off). I hate being woken up for email
version 1.2.1
- Made the folder loading asynchronous so it doesn't hold up the generation of the config dialog
version 1.2.0
- Fixed the config dialog to display the proper path for IMAP folders. Unfortunately, this means a lot of dcop calls, that slow down the generation of the config dialog. Hopefully, this can be minimized with pydcop
- Changed the speak code to work without kttsd. If you dont have kttsd, it just says that you have new mail, not how many new messages
- There were a lot of code changes, so I expect bugs
version 1.1.4
- Cleaned up layout code, list of folders is now vertically centered
- Fixed config dialog to allow a maximum of 7 monitored folders
version 1.1.3
- Added a button to toggle the speech on/off
- Added tooltips to all buttons
version 1.1.2
- Fixed speech to say message not messages if number of new messages is 1
version 1.1.1
- Added option to disable speech in config dialog
version 1.1.0
- The theme will speak out how many new messages you have on an update if the number is larger than before (requires kttsd setup properly and running)
- Clicking the envelope icon forces an update
- Clicking the folder names opens the kmail window with that folder selected (This only works if you are running kmail within kontact and the accelerator for chooisng kmail is the default CTRL+2)
version 1.0.1
- fix the icons to be consistent across themes
Ratings & Comments
21 Comments
Hello, It is not working with aero aio 0.9.1. When I hit the "install" button of aero the plugin does not appear. Any hint? Should I wait for a newer version of the plugin? Cheers!
Unfortunately, I've sort of ended support for this plugin as its implementation becomes much easier with some patches to kmail. See http://www.kde-look.org/content/show.php?content=35578 Hopefully this patch will make it into KDE4 (rewritten for DBUS) The version I now use relies on this patch, so I'm not likely to work on fixing the old plugin for aero 0.9.1. If you feel like applying the patch and compiling kmail for yourself, I'll send you the new plugin. Sorry, Kovid.
I'm confused: how do I have to start that widget? And what is aiz? When I rename it to skz superkaramba finds it but does not display anything, when I unpack it superkaramba cannot find it. All the other themes I use have a .theme file but I cannot find anything like that in your archive.
I haven't read carefully. I see it needs something called Aero Ayo to install it. So I cannot use this as a stand alone mail"ticker"? I am looking for something that can be used as a mailticker like the mailtickers that The Bat! and FoxMail provide (Windows). Best would be a simple ticker with black background that shows the mails that are new in kmail. I had hoped I can somehow clone some code from this one because there doesn't seem to exist a simple mail ticker for linux.
This is a plugin for the Aero AIO SK theme. Read the USAGE section above. At the moment KMails DCOP interface doesn't expose actual messages, only message counts. I had to write my own IMAP client in Python for this plugin. I would suggest you read the CAVEATS and FEATURES sections before trying to use this plugin.
I've created a patch to kmail that gives access to the From/Subject/Date fields for messages in KMail folders via dcop. See http://bugs.kde.org/show_bug.cgi?id=121844
When I click on the see list of unread messages, it says No Messages. You need PyKDE for this functionality. However, when I search for PyKDE, and go to the web site for it, it only supports KDE up to version 3.3 (http://www.riverbankcomputing.co.uk/pykde/index.php) Any idea how to get this to work? Thanks!!! Joe
The riverbank pykde bindings work with kde 3.5 as well, see this thread for the small changes you have to make to get it to compile. http://www.mail-archive.com/pykde%40mats.imk.fraunhofer.de/msg05768.html Anyway, since a lot of people seem to have trouble getting PyKDE working, I've coded a non-pykde workaround in the latest version (2.2.0). It's not really tested, so I don't know if it works.
Thanks!!! I will give it a try as well. Joe
Ok, I don't get that original error now, but when I have a mail in my inbox (And have selected my inbox in the configuration), it says No Messages. Try clicking the Force Mail Check button. The plug in does show how much mail I have though. Looks like it didn't require that pykde program, however. Thanks again!!! Joe
Can you set DEBUG=True in the the file ~/.aero_aio/kmail_aio.py, run SK in a terminal and post the output. Thanks.
Also be aware that message viewing only works if the folder belongs to an IMAP account
I installed this via Get New Stuff. I opened the file through the config dialogue of Aero AIO, but it just doesn't show up. What's going on? I get an error that says: Traceback (most recent call last): File "/home/mrugesh/.superkaramba/aero_aio/config_dialog.py", line 801, in buttonAddClicked os.mkdir(newdir) OSError: [Errno 2] No such file or directory: '/home/mrugesh/.aero_aio/sounds/kmail/'
Are you using the latest aero aio? Do a mkdir -p ~/.aero_aio/sounds/kmail in a terminal and then try it.
Can you do a thunderbird version too please?
This theme uses dcop which is a KDE specific inter-process communication mechanism. I know of no way to communicate with a running instance of thuderbird.
I love it! But can you give the possibility to adjust the folder-names for display? Right now it reads: Lokale Ordner/Posteingang/mailbox1 #Mails Lokale Ordner/Posteingang/mailbox2 #Mails Lokale Ordner/Posteingang/mailbox3 #Mails Is it possible to ONLY display the name of the mailbox (like in your screenshots)? Thanks in advance!!
Hmmm...that's interesting. Are you using the latest version of the script? Its setup to use the displayName that is used by kmail. The following command is used to get the folder display name: dcop $(dcop kmail KMailIface getFolder $(dcop kmail KMailIface folderList|grep mailbox1)) displayName run it in a terminal, if you get the same output as you see in the theme, then I would suggest you open up kmail and right click on the folder -> click properties, name the folder to whatever you want. The new name should show up when you restart the theme
hi again! when I execute your command then it gives me the correct (short) name of the mailbox. but in SK it's always the long version with all the paths. and yes, I'm using your latest script. In the configuration dialog of your plugin I also see the long paths. what could it be?? thanks!
me again ;-) I just recognized that in both Kmail-Scripts you are using "displayPath" instead of "displayName". I replaced these 2 and: now it works like I wanted it: only names, not whole path. Greets Armin
Hmm...I do use displayPath in kmail_gui.py, as folders may have identical display names and the user should be able to recognize which is which, however in kmail_aio.py it only uses displayPath if the folder path contains "inbox" in it, since if the user has several accounts, there would be multiple inbox entries. Here's the relevant code: t = "displayName" if self.folders[i].lower().find("inbox") > -1: t = "displayPath" I'd like to understand why this results in t = "displayPath" for you? Could you add a print self.folders[i] below t = "display"Name", run superkaramba in a terminal and post the output. If its too much trouble never mind. Thanks, Kovid.