mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-25 12:44:35 +00:00
Call get_report before while loop in loop()
This commit is contained in:
parent
d8430aa089
commit
f76f7c65da
|
@ -64,16 +64,14 @@ get_report() {
|
||||||
|
|
||||||
# Continually run and report every volume change (into stdout)
|
# Continually run and report every volume change (into stdout)
|
||||||
loop() {
|
loop() {
|
||||||
|
get_report
|
||||||
pactl subscribe | grep --line-buffered "change" | while read -r _; do
|
pactl subscribe | grep --line-buffered "change" | while read -r _; do
|
||||||
get_report
|
get_report
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"loop")
|
"loop") loop ;;
|
||||||
get_report
|
|
||||||
loop
|
|
||||||
;;
|
|
||||||
|
|
||||||
"once") get_report ;;
|
"once") get_report ;;
|
||||||
|
|
||||||
|
@ -107,8 +105,5 @@ case "$1" in
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*) >&2 echo "Invalid usage, argument '$1' not recognized."; exit 1 ;;
|
||||||
>&2 echo "Invalid usage, argument '$1' not recognized."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue