Xsettingsd not work as a login script

A few months ago, I encounter Intellij IDEs (e.g., IDEA, PyCharm) not scale well in 4K screen, and the accepted solution solved my problem:

But after the upgrade, this method fails to work, and I have to run xsettingsd manually after booted.

I want to know the difference between running xsettingsd as a login script and running it manually after booted?

I also noted that even if I terminal xsettingsd by Ctrl-C, the scaling effects still work. What does xsettingsd do on earth? Why does scaling still work after xsettingsd is terminated?

That’s not the right place to put it. You must add xsettingsd — the executable, not the script — to your ~/.xsession file. See the man page… :arrow_down:

man xsettingsd

I suppose you could also add it to ~/.xinitrc, though.

What should I add into ~/.xinitrc? I tried to append

xsettingsd

to it. But it does not work either.

I found a workaround way, but don’t know why.

I noticed that scaling does not work if xsettingsd is a daemon. On the other hand, if I run it manually and scaling still works even if it is terminated by Ctrl-C. Therefore, I set a timeout for it:

timeout 5s xsettingsd

The shell is placed as a login script.

Xsettingsd is a lightweight xsettings daemon which provides settings to Xorg applications via the XSETTINGS specification when not running one (like when using KDE).
Xsettingsd - ArchWiki