#! /bin/bash # If possible use the KDE program kdialog # otherwise fall back to the generic X program xmessage. if test -x $( type -p kdialog ) then PopupProgram='kdialog --error' else PopupProgram='xmessage' fi # If hp-toolbox cannot access a hplip device # then it doesn't show up on the X window system # it only shows an 'ERROR...' message on stderr # but exits nevertheless with zero exit code. if test -x $( type -p hp-toolbox ) then hp-toolbox 2>&1 1>/dev/null | grep -q 'ERROR' && $PopupProgram 'No configured HP device found' else $PopupProgram 'Cannot execute hp-toolbox.' fi