#!/bin/sh . "lib_common.sh" . "lib_handle.sh" help() { cat << EOF ${0}: Change volume options: -i [Vol] Increase volume by Vol -d [Vol] Decrease volume by Vol -s [Vol] Set volume to Vol -p Show the current volume -t Toggle between mute and unmute -h Print this message and exit EOF exit 0 } volume_handle check_program [ $# != 1 ] && [ $# != 2 ] && invalid_use while getopts "i:d:s:pth" option; do case "${option}" in i) run --reload-status "volume_handle up ${OPTARG}" ;; d) run --reload-status "volume_handle down ${OPTARG}" ;; s) run --reload-status "volume_handle set ${OPTARG}" ;; t) run --reload-status "volume_handle toggle" ;; p) volume_handle get-current ;; h) help ;; *) invalid_use -h ;; esac done invalid_use