Skip to content
Snippets Groups Projects

check existence of notify-send

Merged Hahn Axel (hahn) requested to merge notify-send-error into master
1 file
+ 13
10
Compare changes
  • Side-by-side
  • Inline
+ 13
10
@@ -434,18 +434,21 @@ function j_notify(){
local _body="$( date +%H:%M:%S ) $2"
local _rc="$3"
local _urgency="normal"
if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
if [ -n "$_rc" ]; then
if [ "$_rc" = "0" ]; then
_summary="OK: ${_summary}"
else
_summary="ERROR: ${_summary}"
_urgency="critical"
if which notify-send >/dev/null 2>&1; then
if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
local _urgency="normal"
if [ -n "$_rc" ]; then
if [ "$_rc" = "0" ]; then
_summary="OK: ${_summary}"
else
_summary="ERROR: ${_summary}"
_urgency="critical"
fi
fi
su "$SUDO_USER" -c "notify-send --urgency=${_urgency} '${_summary}' '${_body}'"
fi
su "$SUDO_USER" -c "notify-send --urgency=${_urgency} '${_summary}' '${_body}'"
fi
}
Loading