BarryODonovan.com

The thoughts, ramblings and rants of Barry O'Donovan

Categories

My Links

Search Posts


Timing Work Periods with KDialog, DCOP and KAlarm

May 24th, 2005 by Barry O'Donovan

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

Posted in OSS, Software | 1 Comment »

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.