Switch Headphones/Speakers w/ Keyboard Shortcut Gnome/Arch

Hello,
I am looking for a way to create a keyboard shortcut that will allow me to toggle between Headphones/Speakers on Arch Linux with Gnome and PulseAudio. Right now I am doing it from audio settings gui every time and it’s inconvenient. Any ideas?
Thanks.

For pulseaudio pactl does this sort of thing. On debian it’s in the pulseaudio-utils package.

Can you give me an example how to do it with pactl?

No, sorry, I’d just be reading the man page and guessing how it might apply to your system. I’d start with

pactl list short sinks

and then experiment with pactl set-default-sink

There’s been long posts over the years on this forum about the use pactl, so there may be others here that can help.