无法在 Arch 上运行 KDE,$DISPLAY 未设置

Rat*_*tle 5 arch-linux xorg kde5 plasma5

我刚刚安装了 Arch Linux。我已经设置了 xorg 并且可以使用 xclock 和 xterm 启动 xserver。

我还安装了等离子桌面。

根据KDE - ArchWiki,我只需要附加exec startkde到文件中.xinitrc。我这样做了,但是等startx离子桌面不运行并且X服务器终止。

startkde当尝试在 tty 上运行时我得到$DISPLAY is not set or cannot connect to X server.

注意:这是没有显示管理器的 kde-plasma。我想从控制台手动运行它。

添加日志文件会很困难,因为它们位于另一台计算机上。

Ema*_*les 1

安装xorg-xinit软件包。该xinit程序允许用户手动启动 Xorg 显示服务器。

sudo pacman -S xorg-xinit
Run Code Online (Sandbox Code Playgroud)

在 ArchWiki 中,有一个在没有任何显示管理器的情况下使用 Windows 管理器(例如 KDE)的教程。为此,请将以下命令添加到~/.bash_profile文件底部。如果该文件不存在,请从 复制骨架版本/etc/skel/.bash_profile。对于 Zsh,将其添加到~/.zprofile.

if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
  exec startx
fi
Run Code Online (Sandbox Code Playgroud)

现在您只需创建您的~/.xinitrc

exec startkde
Run Code Online (Sandbox Code Playgroud)

通过这样做,X 将在您登录执行~/.xinitrc文件之前启动,从而启动 KDE 会话。

此致。