There's an app for that: https://github.com/zacharee/Tweaker
You'll need to use adb to grant special permissions that an app can't request on its own.
adb shell pm grant com.zacharee1.systemuituner android.permission.WRITE_SECURE_SETTINGS adb shell pm grant com.zacharee1.systemuituner android.permission.PACKAGE_USAGE_STATS adb shell pm grant com.zacharee1.systemuituner android.permission.DUMP
There's an app for that: https://github.com/zacharee/Tweaker
You'll need to use adb to grant special permissions that an app can't request on its own.