Mikolaj Machowski posted an nice example of using KDialog with DCOP to the KDE Developers mailing list a while back:
#!/bin/bash
PROGRESS=$(kdialog --icon kalarm --title "Short rest" \
--progressbar "Take a break..." 30)
if [ $PROGRESS ]; then
for (( i=0; i<30; i++ )); do
dcop $PROGRESS setProgress $i
sleep 1
done
dcop $PROGRESS close
fi
The purpose of Mikolaj's post was to suggest a method of regimenting work periods - e.g. 20 minutes on, 5 minutes off - using the above script and KAlarm, a personal alarm message, command and email scheduler. But, more than that, it shows off one of the many hiddens treasures of KDE: KDialog, which allows shell scripts to take advantage of some of the KDE widget set, and DCOP, KDE's Desktop COmmunications Protocol.
More information and a tutorial can be found at:
http://developer.kde.org/documentation/tutorials/kdialog/t1.html
Comments are closed.