Archiwum

Posty oznaczone ‘KDE’

KDE – Using notification area within a shell script

Grudzień 7th, 2010 Brak komentarzy

Using KDE notification area within shell script gives a lot of useful possibilities. You can easily get feedback from scripts running in background and checking logs or running services.

To create above notification as example I used quite simple script that uses kdialog command. and basic HTML tags.

#!/bin/sh
 
message(){
cat << EOF
Say <strong>hello</strong> using your <font color=red>nofication</font> area.
Date: <em>`date`</em>
Used space: `df -h | grep sda1 | awk '{ print $5 }'`
Load average: <u>`uptime | awk '{ print $10 $11 $12 }' | sed s/\,/\ /g`</u>
EOF
}
 
timeout=20
kdialog=`which kdialog`
 
${kdialog} --passivepopup "`message`" ${timeout}
Tagi:,