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