Just be mindful that some manufacturers do the extremely shitty thing of placing the socket on the headphones in a very specifically shaped recess that only their cables will fit.
That sounds like a good idea, actually. A lot of those adapters/cables are bastardisations of the USB-C standard, and just re-use a couple of pins to pass on analog audio. I’ve seen at least three variations of it. If it’s not standard, it should not be possible to plug it in to any standard socket.
The right way to do it is with a proper digital-to-analog converter in the adapter. I hope that’s the most common way today, but I haven’t shopped around in recent years.
I have a storagebox at hetzner. My script does:
I can access the storagebox by password, too. So this is my disaster recovery in case my house burns down with all my devices. I’ll just buy another laptop the next day, and me and the Mrs can admire all my code and our wedding videos within a few hours.