After I updated to Android 11, I noticed this button kept popping up on my screen whenever I'd tilt my device with rotation lock on. It annoyed me, so I made this in a day.
I cannot make it clear enough that this requires a rooted device, so please don't complain if it doesn't work due to yours not being rooted. I wouldn't recommend rooting just for this - you can use ADB instead.