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

This commit is contained in:
Seth Underwood
2023-01-07 13:18:55 +09:00
committed by Koichi Murase
co-authored by Koichi Murase
parent 60332ed8fb
commit ce6e26ddee
+3 -1
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