Abstract |
This document describes how to use KDE dialogs in shell scripts with kdialog. It is presented as an example based tutorial. This document is matched to Qt 3.2 and KDE 3.2. |
There are some misconceptions that KDE is only a graphical environment. While it is true that KDE is an outstanding desktop environment, the Unix heritage of command line and scripting is also well supported by KDE. In particular, KDE applications can be controlled from the command line, and shell scripts can make use of some of the KDE widget set.
To use this tutorial, you'll need to have some basic familarity with command line fundamentals, and be at least aware of shell scripting. Like any other programming environment, effective shell scripting requires solid knowledge of the environment, however you should be able to make sense of at least the examples with only basic understanding. The downside to this is that if you are very familiar with shell scripting, some of the explanation is likely to be redundant.
This tutorial assumes that you are using the GNU bash shell, or something directly compatible. Users of other shells (especially csh and variants) may need to modify the examples to make them work.
Shell scripting techniques and usage varies a lot. Sometimes a script is only even meant to be run by the system (e.g. as cron job), however sometimes scripts are really applications intended to be run by users. KDE includes features that allow you to use some of the KDE functionality from a shell script, which can save you some work, and can also make your script feel like it is part of a nicely integrated application set.
As an example, consider something like a password dialog. If you need the user to enter a password, you can easily generate a dialog from your script that looks like the following.
Next >>> | ||
kdialog Usage |