marioortizmanero / polybar-pulseaudio-control

A feature-full Polybar module to control PulseAudio
MIT License
471 stars 49 forks source link

Add ability to pass in format strings #39

Closed samyak-jain closed 3 years ago

samyak-jain commented 3 years ago

As described in issue #27, currently this script does not have the ability to control the output of the script. I have added the --format argument with which you can control the output of the script.

As an example: bash pulseaudio-control.bash --format '${VOL_LEVEL}' output should output only the volume level

The default format is $VOL_ICON ${VOL_LEVEL}% $ICON_SINK $SINK_NICKNAME

samyak-jain commented 3 years ago

Regarding the CI suggestions, I think both are unavoidable because of the same reason. The only time the varaibles are used is when I run eval on the string.

marioortizmanero commented 3 years ago

Yes, what I meant is that you can add a comment above the line where the linter complains to ignore the warnings - https://github.com/koalaman/shellcheck/wiki/Ignore

Formatting seems OK to me now

marioortizmanero commented 3 years ago

The second warning can be fixed, though. You can use eval echo "$FORMAT" instead of echo $(eval echo "$FORMAT")

samyak-jain commented 3 years ago

Ah. Ok. I get what you mean. I've fixed the issues now.

marioortizmanero commented 3 years ago

One last thing: can you update the readme usage message?

samyak-jain commented 3 years ago

No worries. Lmk if I missed something else

marioortizmanero commented 3 years ago

I think this is ready to merge then! Thank you for the contribution. I'll release a new version soon, hopefully after #42 is done.