Krefty -- Quick Reference Application for KDE
main page
gnomedia email
Ever needed to quickly look up the parameters of 'cvs diff', or can't remember what the shortcut is for putting down the flaps on FlightGear? Do you have a stack of O'Reilly Pocket References, fading printouts and yellow post-its with hotkey listings, short cuts and cheats surrounding your workspace?


Well, I do, and for that reason I created Krefty, so that I could popup the shortcuts that I needed on the desktop when I needed them.

Krefty is a KDE application that allows the user to load an XML file (called a Krefty sheet) containing a set of hotkeys, commands and so on for a particular application. Switching from one sheet to another is done by use of a drop down combo box which has a list of installed Krefty sheets.

The application package contains the source code for the application. It requires KDE 3.1, Qt3 and xsltproc (part of KDE) in order to compile.

The XML files are the actual data sheets themselves and will be added to as more are created. Without this package, there will be no data!

Download the two packages above.
Unpack the source code somewhere, and then type:
% ./configure
% make
% su -c "make install"
This will create the executable, help files and part library and install them (by default in "/opt/kde3").
Run the Krefty application (should be on the Utilities sub menu).
This will create an entry in your $KDEHOME directory (e.g. at "/home/user/.kde/share/apps/krefty/data/") and copy the basic Krefty files into it ("krefty-intro.xml", "krefty.xsl", "krefty.dtd" and "krefty.css").
Change into this directory and unpack the "krefty-sheets-x.x.tar.gz" package
This will add the various XML files.
Refresh the list from Krefty, and, viola, the installed sheets should be in the drop down combo box.
Modifying and Creating Krefty Sheets
A Krefty XML file is a standard XML file, the structure of which is described in "krefty.dtd". The various XML files are loaded into Krefty, transformed by the XSLT processor ("xsltproc") and converted into HTML internally. This is then formatted by the CSS stylesheet ("krefty.css") and displayed in the application.

In this process, there are three places that we can modify, or customize, the output:

Modify the XML file
Modification of the XML file allows us to change the data that is displayed. This can be done to rearrange the order of the entries, add or delete entries and so forth.
Modify the XSL file
Changing the XSL will change the way that the XML is converted into HTML and can be used to change the layout of the HTML file.
Modify the CSS file
Modify the CSS file to change fonts, colors, borders and margins.

Creating new XML files is best done by deciding which of the existing files is closest to what you want and then modifying that one. Check the "krefty.dtd" file for details on which elements and attributes go where. If you create one that you feel will be useful to other people, then send it in and I'll add it to the package.

Note: the XML file format is not finalized yet. I'll wait until a few people have used it and created some other Krefty sheets.

Some Design Decisions
Simple interface.
Krefty uses basically three key strokes. Page Up/Down to scroll the page (if needed) and Tab to switch the focus to the drop down list and change sheets.
Standard file format
A Krefty sheet is a standard XML file, I hope that will encourage others to create more Krefty sheets and distribute them.
Why aren't the data sheets installed with the program?
Normally, an application is installed as root, and I want the data files to be installed somewhere that the user can add and modify them. This isn't known until the user first runs the program, so that is when we install the sheets. Plus they can be added to without having to rerun the compile/install commands.
No configuration dialog.
I haven't put a configuration dialog as the whole thing is so simple it didn't seem to require one. If it becomes more complex, then I'll add one.
I want to put the data files somewhere else!
Edit the resource file for the application. This is normally somewhere like "~/.kde/share/config/kreftyrc". Change the "dataDir" entry to point somewhere else and restart the application.

Last modified: Fri Aug 15 19:12:12 CEST 2003