Modify X11 scaling settings from cli or script (Method to help fix font scalling)

Is there a way to modify X11 scaling settings from the terminal?

I find that I am able to get proper scaling in X11 apps, along with sharp fonts, if I first set the X11 scaling settings to “scaled by the system” and then revert to “scaling themselves”.

The problem is that I do not want to do this manually on each login; I want to set a script to do it automatically.

For overall scaling, or just fonts? For overall scaling on X11, xrandr can do it. I just replied to a scaling question, the info and link there might help.

Only the fonts.

However, I do not have a scaling issue; I want to modify the X11-specific scaling settings in the KDE system settings via CLI.