Linux – Can’t run KDE on Arch, $DISPLAY not set

arch linuxkde5plasma5xorg

I just installed Arch Linux. I have set up xorg and can start the xserver with xclock and xterm.

I have also installed plasma-desktop.

As per the KDE – ArchWiki I only need to append exec startkde to the .xinitrc file. I did that, but upon startx the plasma desktop doesn't run and X server terminates.

When trying to run startkde on the tty I get $DISPLAY is not set or cannot connect to X server.

Note: This is kde-plasma without a display manager. I want to run it from the console manually.

It will be difficult to add log files since they are on the other machine.

Best Answer

Install the xorg-xinit package. The xinit program allows a user to manually start an Xorg display server.

sudo pacman -S xorg-xinit

In ArchWiki there's a tutorial to use Windows Managers such as KDE without any Display Manager. To do this, add the following comands to the bottom of ~/.bash_profile file. If the file does not exist, copy a skeleton version from /etc/skel/.bash_profile. For Zsh, add it to ~/.zprofile.

if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
  exec startx
fi

Now you have just to create your ~/.xinitrc

exec startkde

By doing this, X will start before you login executing the ~/.xinitrc file, starting the KDE session.

Best regards.

Related Question