I've been trying to find a consistent shell command to adjust the volume on my laptop. I was recommended to try (for muting/unmuting):
pactl set-sink-mute 0 toggle
and it didn't work, I got the error
Failed to get sink information: No such entity
After some more looking, I found out that changing
1 in the command worked. I think this is because pactl assigns my sound card a number when it starts up, and that number changed when I restarted my laptop.
That was fine, but when I restarted my laptop the audio keys aren't working again. I tried the working command in the shell and got the "No such entity" error again. If I changed
1 back to
0 (i.e. the original command), it works again.
This is confusing to me, because I think I only have one sound card. In any case, if the number assigned to the card isn't consistent, is there a consistent way to refer to that card and adjust its volume?