OK, I found out how to get a useful name. It’s a different SDL API (“game controllers”). Instead of using SDL_Joystick* you use SDL_GameController*. For example:
SDL_GameController *gc = SDL_GameControllerOpen(0);
Will print X360 Wireless Controller instead of Xbox 360 Wireless Receiver on Linux, and for a PS4 controller it returns PS4 Controller instead of Wireless Controller. I guess this api also makes the button layouts all consistent. Unfortunately I wish I had known about it before because it’s not event based like the SDL_Joystick api.
EDIT: Actually, there may be events, I have to check it out more.
Well I’ll be damned. It has events, so this is a lot easier and better…