How to remap gamepad?

I connected a PS4 controller to my PC over bluetooth, it works, it is detected, all the buttons work but there is one problem.

At least one of the games i’m trying to play do not detect the buttons in the correct order, e.g. triangle is circle, circle is x, x is square, square is triangle, it’s like they’ve all been cycled.

How would I go about correcting this?

Do note I am on wayland, and I’m using Hyprland as well so i’d prefer a way to do this through the terminal or a config file.

Normally I would use steaminput to resolve this little problem, but I cannot, the game doesn’t seem to detect the controller at all if steaminput is enabled for it.