lib/bourne-shell: Add check for notify-send command prior to setting alert alias

This commit is contained in:
Seth Underwood
2023-01-06 21:36:36 -05:00
committed by Koichi Murase
parent 60332ed8fb
commit ce6e26ddee

View File

@@ -74,7 +74,9 @@ fi
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
_omb_util_alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
if _omb_util_binary_exists notify-send; then
_omb_util_alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
fi
# Alias definitions.
# You may want to put all your additions into a separate file like