Friday, February 15, 2008

KDE Utils: Falling in love all over again

Today we're going to look at the little tools in KDE4, or at least some of them. There are far too many to be able to cover in one blog entry, and so I've decided to cover a few of the ones that I personally use and which have had visible improvements over their KDE3 counterparts.

What blog about software would be any good without screenshots, right? Documentation also requires screenshots, and both patch reviews and bug reports are helped when accompanied by screenshots. Sounds like we need a good screenshot tool to take pictures of our desktops, and thankfully KDE4 comes with one of the nicest ones around: KSnapshot.


KSnapshot in KDE4


As in KDE3 we have a picture of our snapshot on the left (which you can drag and drop), our main controls to the right of that and our snapshot settings at the bottom. As in KDE3 (and just about any KDE application), you can save your files to a remote system (that's how I got the snapshots online for this blog entry, in fact) and KSnapshot lets you define how you want your snapshot taken. Don't want window borders? No problem! Need X seconds to set up your perfect shot? Can do! If you put a number or a date (!) in your snapshot name, it will auto-increment it for you on your next take. Such a handy little app.

It sports four snapshot modes: full screen, full window, section of window and region. The "section of window" is very cool in that it allows you to click on an area of a window, such as a toolbar or the document area, and it will grab just that portion of the window. So far, other than the nice Oxygen stylings, things are the same.

In KDE3 there was one recurring theme from users of KSnapshot: "we want more control over the final result." Some wanted to print (which was supported in KDE3), others wanted to crop, put drop shadows, annotate .. and on and on. If the KSnapshot maintainer, Richard Moore, hadn't been careful KSnapshot would soon have become a full image editor! What to do?

The print button was removed and replaced with an "Open With" button which lists every image manipulation application that is registered on your system. So with one click you can open your snapshot in Gwenview or Krita or KolourPaint or whatever app you want, really (sure, go ahead and edit it in KHexEdit ;). From there you can manipulate the snapshot to your hearts content without restrictions. This decision helped keep KSnapshot itself small and focused in its mission.

Another nice touch in KDE4 is the region mode. In KDE3 you could grab a region of the screen, but there was virtually no feedback as to what was going on while you did so. Not any more!


KSnapshot in region grabber in action


When you click "New Snapshot" a little timer (which, of course, follows your colour scheme! ah, details!) appears in the upper left corner counting down the seconds left until the snapshot is taken. When in region mode, once the time has run down to zero a snapshot of the whole screen is taken and you can now click and drag an area to snapshot. The selected region remains clear while the rest of the screen is grayed out, as you can see in the screenshot above. You don't have to get it right the first time, either: little translucent drag handles appear on the edges and corners of your selection that allow you to adjust the selection to your heart's content.

It is that one feature alone that has me falling in love all over again with this handy tool that I end up using so often.

KSnapshot isn't the even the beginning of the parade of small tools in KDE4, though. Take KCharSelect, for instance: in KDE3 it was very, very basic and very, very cryptic. You could pick a font and it would list all the characters in it. And I mean all. So if you were looking for the copyright symbol ... you could be hunting for a while.



Besides allowing one to pick both the font type and size to peruse, KDE4's major improvement comes in the form of search and metadata in a more pleasant layout:



Selecting a character will give you some information on it in the information panel. The information includes details on the character itself, it's representation in various formats such as XML/HTML encoding and even cross references to related characters.

Where this gets really useful is when using the search bar. Located at the top of the widnow, the search bar allows you to sift through this text quickly. Typing "copyright" at the top brings up all the characters which have the term "copyright" in their information blurb. Finally I can find special characters quickly and without even necessarily knowing their exact name! I love it!

For those large Unicode fonts which may have hundreds upon hundreds of pages of characters, KCharSelect allows you to define the set pages you'd like to look at. This is done via a pair of selection lists right next to the font selection. This lets you select a font, a size and then narrow down which characters are displayed by simply moving through the fields left to right (or right to left if using an RTL desktop).

For quick note taking, KDE4 comes with KJots. If you want a full-meal-deal kind of note tool, I recommend checking out Basket. It's an insane app that can do pretty much anything with notes and does it with an extra helping of style and eye candy. But sometimes you just want a simple note taker (as I often do), and that's what KJots is for. Like KSnapshot and KCharSelect, KJots got its start way back in KDE1 and it still with us in KDE4.

It's gone through a few UI revisions in that time, as you can imagine. It started out as a useful if slightly ugly duckling with a menu listing your note books, a row of buttons at the bottom for bookmarks, and a list of pages in the currently open book on the left. This obviously didn't scale very well if you had lots of note books or bookrmarks. In fact, it gave the app an downright odd use pattern: open a menu (or call up the book dialog by keyboard shortcut) and select a book, move to the left pane to select a page, move to the right to edit; or mouse to the bottom to select a book, uhm, bookmark, move to the left pane to select a page, move to the right to edit.

The file format also left some things wanting: you couldn't have more than one level of pages and no nested books and it was a bit brittle.

When I took maintainership of the app in KDE3 times I cleaned up the UI a bit by harmonizing the navigation into the left panel, added printing, a book overview so you could view all your pages in one scrolling view, proper bookmarking, autosave and cleared up a bunch of bugs.

Then along came Jaison Lee. We met a conference in Ohio shortly after Jaison started contributing patches to KJots and if I recall, it was during the conference that I tricked .. er .. convinced Jaison to take over maintainership of KJots. Under his hand, KJots really stepped up.


KJots in KDE4


He swapped the file format to XML, added rich text editing, made it possible to nest books and added a bunch of other nice touches. Auto-bulleted lists, being able to mark pages in the left side with colours and content search are nice features as well. Pradeepto Bhattacharya and Stephen Kelly are now looking after KJots, so the legacy continues, hopefully for another 10 great years.

The rich text editing alone is enough to make me fall in love all over again with KJots. Colour marking is useful if a bit rough still, the overview HTML looks straight from 1992 (my fault, I take the blame) and could use a nice facelift (any HTML/CSS gurus out there? ;) and being able to add images or other attachments to pages would be nice. Even as it is, though, KJots is approaching a very nice balance of power, reliability and simplicity: the configuration dialog has all of three options in spite of being able to do so much with it!

As a closing teaser, if you've ever wanted to clear out the tracks your web browsing and file editing has left behind, look no further than Sweeper from the KDE Utils package:


Sweeping out my usage tracks with Sweeper


Simple, fast and powerful. Beautiful!

I could go on and on about tools like KGpg or KCalc or ... but I'm out of time. Suffice it to say that there are a lot of very nice tools in KDE4, many of which have improved noticeably from KDE3 to KDE4. I hope you take the time to explore the various nooks and crannies of KDE4 long enough to discover these jewels; remember: KDE is more than a desktop shell and a file manager .. it's also a collection of truly great applications (.. and a development platform, and a community of terrific people, and ... ;)