Lightning add-on with Google Calendar-like color palette

I’ve started using Lightning add-on for Thunderbird lately. Oh and Thunderbird, too. Again.

I just figured Evolution is unreasonably resources demanding, works a bit slowly on my notebook (Intel(R) Core(TM) Duo CPU T2250 @ 1.73GHz, 4GB RAM, ATI Xpress 1250 with 256MB), has a terrible connection error dialog that looks stylish in red and overlays message window list but pops up way too often — with many accounts and a bit flaky Internet connection and/or frequent sleep and resume cycles that gets just irritating because as a user I have to dismiss them manually or else they remain in their place forever limiting view of the list of new and old messages. Evolution also offers a pretty inconvenient way to turn HTML formatting on or off on a per single message basis. You’d have to go all the way to preferences and locate it in some section and tick the box off or on to get a single e-mail sent out in HTML if you prefer plain-text most of the time. That’s just too time-consuming and frustrating and IS a lot of work. Finally, I figured it crashes quite often under certain circumstances. Overall it works stable 98% of the time and is a very good mature e-mail client and I’d personally recommend it to a lot of people.

I didn’t feel like hunting down its bugs, though, because at the end of the day performance wise I’d still not be happy with Evolution, so I decided to give Thunderbird another try. I used to run it, it was OK. It met most of my expectations back then but at some point in time I defined my own user policy where I’d strive to use default DE applications as much as I could. I felt it would give me a more consistent look and feel, which kinda matters to me when I become a regular desktop user and not a Linux administrator who works mostly with black terminal and a web-browser.

So, I used to use KMail and Evolution and they were both OK. Since the last time I’ve used Thunerbird it got a cool add-ons manager and plenty of useful extensions (like Lightning, Gnome Integration, Copy As Plain Text, Personal Level Indicators, etc.) as well as nifty personas, sort of skins that can deliver a really nice touch of personality to your Thunderbird  if chosen wisely. Some of the extensions that I found useful and a very cool persona/skin can be seen in this screenshot:

Extensions that I found useful and persona/skin demonstration

Continue reading

Advertisements

Placing Evolution windows to specific viewports with Compiz

Compiz has lots of nifty plug-ins and one of them is called Place. What it does essentially it takes a window and puts it on a specific desktop you tell it to.

The tricky part is to write rules to select windows. Evolution proved to be quite a pain to handle. I usually use 6 virtual desktops, or viewports in Compiz parlance. I have two rows of them, each has 3 virtual desktops. I’m used to having an e-mail client running in viewport 3, row 1 (X3:Y1) web-browser and console in viewport 1 (X1:Y1).

Well, initially my idea was to  grab a Window Title for Evolution’s Compose Message window and have it explicitly excluded in the rules. That kind of approach worked just fine on my office workstation where I use Thunderbird, but with Evolution this sort of rule:

title=Evolution & !title=”Compose Message”

Just didn’t work. What happened was either Compose Message window would be still forcibly placed to viewport 3, or, totally weird, main Evolution window would be transferred to active viewport and Compose Message window would take place of main Evolutoin window defined by Place plugin rules (in my case viewport 3, X3:Y1).

But as I said a little earlier, I keep my Chromium window in viewport 1 and when I click an “e-mail to” link I’d love to see Compose Message window in viewport 1, or in other words I want it to follow the viewport I’m working in. Well, that logic expressed in a rule above proved to be a total failure. I tried literally all the options for matching rules: window class, title, role, etc. — none of them worked. I’ve actually almost given up on this idea to take control of Evolution’s windows and left the rules as they were the last time I messed around with Place settings.

Eventually, what I ended up with, though, and it comes as a surprise to me as well, was a simple:

role=EShellWindow

Which was created sort of accidentally, a leftover of the code from the last time I attempted to figure out the matching rules for Evolution, but it turned out to be exactly what I needed.

So, if you need to forcibly place Evolution on its launch to any viewport, just use this rule to match the Evolution main window. That’s it. Compose Message will follow your viewport.

If you feel a little uncomfortable with Compiz’s matching rules syntax, don’t worry I felt it was a little unusual as well! Here’s a nice post, though, that breaks down the most important aspects of the window matching deal:

http://technology-flow.com/articles/control-window-behavior-compiz/

StarDict. Customizing dictionary entry colors.

I use StarDict. StarDict is more or less good dictionary program for Linux (in fact, it runs not only on Linux). It’s not perfect but it’s fairly good and even has some interesting functionality, scan selection for instance. You select a word anywhere where it is selectable and then press hot-key combination and a nice little window emerges on your display right besides your current cursor position. Very convenient when you read web-pages, or e-books, or what not. You can even convert the famous Lingvo dictionary and use StarDict as a front end. This brings a powerful dictionary to Linux and other platforms.

One thing that really irritates me in StarDict, and I mean it, it’s the colors choice for dictionary entries elements. By default StarDict comes with ultra light green and violet colors. Given most UI are bright colored it still remains a secret for me why developers decided to choose violet and ultra light green as default colors AND not give us any other options. Oh, I hate those colors on my bright gray canvas!

So, one day I realized I couldn’t take this anymore and I had to do something about it so I started figuring out and eventually I raised the question on StarDict forum. Thankfully, some kind people gave me a hint.

At that moment in time I was involved with Source Mage GNU/Linux. It’s a wonderful rising distro that sports a very cool sorcery package management and build system. It works almost like magic at times. So, when I figured out how to change colors for StarDict dictionary entry colors I scribed a spell. Nope, I’m not a wizard, only an apprentice. The result of my work can be found here: sourcemage/grimoire/codex/stable/spelling/stardict/PRE_BUILD

Note the following code:

sedit "s:violet:darkgray:" tests/t_articleview.cpp &&
sedit "s:violet:darkgray:" stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp &&
sedit "s:green:brown:" tests/t_articleview.cpp &&
sedit "s:green:brown:" stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp

this is what does the magic. The sorecery politely asks a user if she wants the colors of a StarDict dictionary entry be changed from extremely light to more serene before the spell is built. Nice. IIRC, sedit isn’t a real program but some sort of BASH construct (probably a function) that wraps sed and allows for simpler use of this tool in sorcery scripts… ahem.. that is spell manuscripts.

Okay, so you probably get the idea already. You can just grep recursively the StarDict’s source code tree and see if these colors – green and violet – are used somewhere and then you can change those to whatever you like (use any of these colors [1]) and see how it looks when you recompile the program.

Well, Source Mage guys were lucky to have me freaking out over this issue. How about your favorite distribution? Honestly, I have no idea. These days I run Arch Linux and it ships StarDict with green and violet colors. Ugh. I had to rectify the situation yet again. And here’s a verbatim copy of commands I used to build a custom package that eventually would look like in this illustration (the latter screenshot, compare to green-violet hideous color combination *wink-wink*):

This is how the default StarDict looks like. Hideous (subjectively, of course!) green and violet.

And this is my idea of a good color choice. I call this color scheme “Serene”. You can look at more examples [2].

And here’s the code. First, sync abs. Okay, first install ABS. No, perhaps first read about ABS, then install it, then sync 🙂

root@sega:/home/ilj % abs
...
ilj@sega:/home/ilj % cp -a /var/abs/extra/stardict/ ~/builds/abs/
ilj@sega:/home/ilj % cd ~/builds/abs/stardict/
ilj@sega:/home/ilj/builds/abs/stardict % lsh
total 36K
drwxr-xr-x 2 ilj ilj 4.0K Apr 15 07:08 .
drwxr-xr-x 3 ilj ilj 4.0K Apr 15 20:00 ..
-rw-r--r-- 1 ilj ilj 1.3K Apr 15 07:08 gtk_gthread_fixes.patch
-rw-r--r-- 1 ilj ilj 1.2K Apr 15 07:08 PKGBUILD
-rw-r--r-- 1 ilj ilj 7.3K Apr 15 07:08 sigc++.patch
-rw-r--r-- 1 ilj ilj 12K Apr 15 07:08 stardict_gcc43.patch
ilj@sega:/home/ilj/builds/abs/stardict % vim PKGBUILD

So, here you open PKGBUILD and add the following block of code

sed -i -e "s:violet:darkgray:" tests/t_articleview.cpp || return 1
sed -i -e "s:violet:darkgray:" stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp || return 1
sed -i -e "s:green:brown:" tests/t_articleview.cpp || return 1
sed -i -e "s:green:brown:" stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp || return 1

right after the patches and before the configure is invoked. Save the changes and exit the editor. Then run

ilj@sega:/home/ilj/builds/abs/stardict % makepkg -s
ilj@sega:/home/ilj/builds/abs/stardict % su
Password:
root@sega:/home/ilj/builds/abs/stardict % pacman -U stardict-3.0.1-3-i686.pkg.tar.xz
loading package data...
checking dependencies...
(1/1) checking for file conflicts [###########################################################################################################################] 100%
(1/1) upgrading stardict [###########################################################################################################################] 100%
root@sega:/home/ilj/builds/abs/stardict % exit

Now run `stardict‘ and never see those so violently light colors again.

There are a couple of things we could do to make dictionary entries look even better. I personally dislike “<—” and ” —>” around dictionary name so I decided to get rid of these. Simply add the following line to PKGBUILD:

sed -i -e "s:& l t;-* ::g" -e "s: -*\& g t;::g" src/articleview.cpp || return 1

Note that “& l t” and “& g tMUST NOT contain spaces in between the three symbols. I had to add additional spaces so that WordPress doesn’t interpret them as “” HTML codes.

Also, after several years of using StarDict I’ve always felt there was something wrong with the way the data was presented. Except the obvious – colors – I found that the dictionary names following right after the last line of the preceding dictionary entry contents gave me a feeling of inconvenience. I figured that adding one more blank line after the end of the contents of any given dictionary entries creates more space that is visually very easy to catch and follow. While this may seem very trivial a mere additional empty line allowed me to navigate large lists of search results with multiple dictionary entries easier and faster. After all, there are highly paid professionals whose job is to improve various things – from furniture and car design to UI design and web-sites usability – by being creative, analytical and meticulous. Often what they do is tweak seemingly senseless things, like adding an extra space or making sure some things are small while other ones are big, which proves very important eventually. I highly recommend that you add the following sed line to your PKGBUILD, you might just like the results in the long run:

sed -i -e "s:append_pango_text(\"\\\n\");:append_pango_text(\"\\\n\\\n\");:g" src/articleview.cpp || return 1

The result of the two above sed commands will look like this:

Notes:

[^ 1] – Note that some colors can be referred to by their names, like darkgray, green, violet, etc. If you used a color name and it didn’t work right (you’d see no usage examples in a dictionary entry at all) simply use hex color value equivalent, i.e. #808000 for Olive and so on.

[^ 2] – More examples of good looking color schemes for Stardict:

Teal, #008080

OrangeRed, #FF4500

Olive, #808000

ForestGreen, #228B22