Closed marioortizmanero closed 4 years ago
If the global getCurSink
is removed, these errors are displayed:
❯ bash pulseaudio-control.bash --up
pulseaudio-control.sh: line 58: [: 102
30
58: integer expression expected
pulseaudio-control.sh: line 60: [: 102
30
58: integer expression expected
❯ bash pulseaudio-control.bash --down
Operation failed: Invalid argument
Because activeSink
is empty when getCurVol
is called. This is because getCurSink
should be called in volUp
and volDown
before getCurVol
. I should also check for more possible errors related to that before removing the global getCurSink
. Maybe if getCurVol
took a parameter rather than activeSink
it would be easier to manage.
EDIT: done
I've noticed that when using the script,
getCurSink
is called twice, and other unnecessary updates are done. I'll document it to do more research and fix it once I have more time:Only running the script:
Volume up -> volume down -> single sink switch -> mute (output is called too many times?)
Random update when seemingly nothing changed:
Update when a new song starts (unnecessary):
Update when the song is paused (unnecessary):
Increasing & decreasing the volume (curiously,
getCurVol
is only called once for the latter)::Other calls: