There's something I don't understand: does switching between laptop and pc with that hub require unplugging one usb c cable from the back of the hub and plugging the other one in?

I'm very interested in a similar setup. So far I don't think I've figured out an elegant solution.

My current solution is to have both devices plugged into the monitor, and use a usb hub to share the peripherals, manually moving the cable to the hub between devices.

I do something similar, but I got a $20 usb3.1 switch on Amazon and taped that to the back of my monitor.

When I want to switch, I just change the input on the monitor and press the button behind it.

It’s not the 1-click solution that I wanted, but it’s close enough and cheap.

Switching USB ports is cheap, switching video signals isn’t.

You might want to check this out then: https://haim.dev/posts/2020-07-28-dual-monitor-kvm/

That was on HN earlier this year. Basically it's software that you run and set up to detect when certain peripherals connect/disconnect and have it switch the input on the monitor automatically. I've been using it and, while not always perfect, it actually works pretty well, especially considering the price.

If you don't always want the monitor to switch inputs (sometimes I just want to quickly switch my keyboard/mouse to my laptop to do something but don't want to switch monitor inputs) you can also just set up shortcuts or scripts (I created an Alfred workflow, for example) and use something like https://github.com/kfix/ddcctl to switch monitor inputs.