startx calls xinit; xinit calls $HOME/.xinitrc, if not found, calls /etc/X11/xinit/xinitrc; xinitrc calls $HOME/.Xclients, if not found, calls /etc/X11/xinit/Xclients; Xclients looks for your window-manager setting.
If you're using a display manager, you intercept the above sequence at the .Xclients/Xclients level, since the display manager starts the Xserver (otherwise the function of xinit).
So if you use "startx", and put in .xinitrc a line "startkde", that will start KDE. But if you did a graphical login, .xinitrc is not read. If you don't have an .xinitrc, then .Xclients takes over. Then you could put in .Xclients "startkde" to start KDE. That would affect both "startx" and graphical login.
I do believe that the contents of the default files, xinitrc and Xclients are probably distribution-dependent.
本文详细介绍了startx命令的启动流程,包括xinit、.xinitrc和.Xclients文件的作用及其配置方法。通过这些配置可以指定启动特定的窗口管理器如KDE等。
1052

被折叠的 条评论
为什么被折叠?



