Simplify and fix delta check
This commit is contained in:
parent
ec28af9a43
commit
bd3a35704f
1 changed files with 4 additions and 5 deletions
5
volbash
5
volbash
|
@ -91,11 +91,10 @@ adjust() {
|
||||||
local delta vol op
|
local delta vol op
|
||||||
|
|
||||||
# Check for valid input value
|
# Check for valid input value
|
||||||
case $1 in '' | *[!0-9]*)
|
if [[ ! $1 -gt 0 ]]; then
|
||||||
echo "error: Delta value must be a positive integer."
|
echo "error: Delta value must be a positive integer."
|
||||||
exit 2
|
exit 2
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
|
|
||||||
# Ascertain the volume level by parsing wpctl's output
|
# Ascertain the volume level by parsing wpctl's output
|
||||||
vol=$(v="$(wpctl get-volume "$sink")"; echo "${v#* }")
|
vol=$(v="$(wpctl get-volume "$sink")"; echo "${v#* }")
|
||||||
|
|
Loading…
Add table
Reference in a new issue