Add pactl support
This commit is contained in:
parent
d85fe4b419
commit
f12dbece18
@ -1,18 +1,32 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Has some undocumented features but they're functional (as far as I know)
|
|
||||||
# and system-independent. just shortcuts for me really.
|
|
||||||
|
|
||||||
argv0="$0"
|
argv0="$0"
|
||||||
|
|
||||||
! which stris >/dev/null 2>/dev/null \
|
# ADDING A NEW SOUND SERVER/CLIENT/WHATEVERIDK
|
||||||
&& printf "%b: Missing stris.\n" \
|
# `volume a` and `volume s` are the system dependent functions.
|
||||||
|
|
||||||
|
# `volume a $2` must set the volume to $2, an integer value. This should be a
|
||||||
|
# percentage, 100% being the loudest possible volume that can be output by
|
||||||
|
# hardware without quality loss. Percentages above 100% will be allowable in
|
||||||
|
# software if using percentage units. If percentage units are implausible to
|
||||||
|
# implement, system units are okay (e.g. 0-$arbitrary scale versus 0-100).
|
||||||
|
|
||||||
|
# `volume s` must output the current volume in integer form in whatever units
|
||||||
|
# are being used by `volume a` on the given system.
|
||||||
|
|
||||||
|
! command -v stris >/dev/null 2>/dev/null \
|
||||||
|
&& printf "%b: Missing stris.\n" "$argv0" \
|
||||||
&& exit 1 \
|
&& exit 1 \
|
||||||
|| true
|
|| true
|
||||||
|
|
||||||
VOLUME_TMP_FILE="$HOME/.volume-previous"
|
VOLUME_TMP_FILE="$HOME/.volume-previous"
|
||||||
|
|
||||||
usage() {
|
unknown_system(){
|
||||||
|
printf "%s: Unknown system.\n" "$argv0" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
usage(){
|
||||||
printf "\
|
printf "\
|
||||||
Usage: %b [function] (argument)\n" "$argv0"
|
Usage: %b [function] (argument)\n" "$argv0"
|
||||||
printf "\
|
printf "\
|
||||||