Pi Zero Headless WiFi

Hi, I’m using the Pi Zero, and I’m trying to setup the wifi. But I have a problem: I can olny use one device at the time. So, is there a way to connect to the wifi editing some config files? I can only use he keyboard and then plug in the wifi dongle after the reboot. Basically, I’m trying to achieve something like this: https://davidmaitland.me/2015/12/raspberry-pi-zero-headless-setup/

Hopefully someone can help me. By the way, I’ve tryied the headless guide above but it didn’t work.

Using OSMC’s preseeding method, you can do this. The easiest way for you would be to do a fresh install, boot with the USB stick inserted, and set up WiFi networking in the OSMC installer.