2020-02-08 19:18:16 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
# check for existing implementations
|
|
|
|
# If $1 command is not available, error code
|
|
|
|
# If $2 is low, normal, urgent, also notify the user. (loud-mode)
|
|
|
|
|
|
|
|
if command -v "$1" >/dev/null; then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
if [ -n "$2" ]; then
|
|
|
|
if command -v notify-send >/dev/null; then
|
|
|
|
notify-send "📦 $1" --urgency="$2" "must be installed for this function."
|
|
|
|
fi
|
2020-02-23 21:35:11 +00:00
|
|
|
printf "%s: 📦 %s must be installed for this function.\n" "$2" "$1"
|
2020-02-08 19:18:16 +00:00
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
fi
|