KDE - Using notification area within a shell script

Using KDE notification area within a shell script gives a lot of useful possibilities as you can easily display feedback from running services, other scripts, log analyzer.

KDE notification

To create above notification example I used shell script that uses kdialog command:

#!/bin/sh

message(){
cat << EOF
Say <strong>hello</strong> using your <font color=red>nofication</font> area.
Date: `date`
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}
Milosz Galazka's Picture

About Milosz Galazka

Milosz is a Linux Foundation Certified Engineer working for a successful Polish company as a system administrator and a long time supporter of Free Software Foundation and Debian operating system.

Gdansk, Poland https://sleeplessbeastie.eu