Update sound-control.sh

This commit is contained in:
Alexander Rosenberg 2024-08-24 16:21:12 -07:00
parent 0c1a9e1697
commit c331844f0d
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -38,12 +38,12 @@ function notify_vol {
-u normal \ -u normal \
-a "Volume" \ -a "Volume" \
-h int:value:"${vol}" \ -h int:value:"${vol}" \
"${icon}" "${icon} ${vol}%"
} }
function check_number { function check_number {
if ! [[ -z "${1}" ]] && ! [[ "${1}" =~ '^-?[0-9]+%?$' ]]; then if ! [[ -z "${1}" ]] && ! [[ "${1}" =~ '^[0-9]+%?$' ]]; then
echo "error: not a valid number: \"${1}\"" echo "error: not a valid value: \"${1}\""
exit 1 exit 1
fi fi
} }