How to Restart KDE Plasma Without Rebooting the Computer

A simple pair of shell commands refresh KDE

Restart KDE Plasma Desktop screenshot

When you run a Linux distribution with the KDE Plasma desktop—a beautiful but notoriously resource-hogging environment—and you leave your computer on for an extended period of time, you'll likely find that the desktop becomes a bit sluggish after a few days. Many people bite the bullet and restart the computer, but if you are using your computer as a server of any kind then a full system may not be in the cards.

Instead, restart KDE Plasma on its own.

KDE Plasma desktop.

How To Restart KDE Plasma 4

The procedure for restarting the KDE Plasma desktop differs depending on which version of the desktop you are running. For KDE Plasma 4, press Alt+F2 and enter the following command:

killall plasma-desktop && kstart plasma-desktop

The first command will kill the current desktop. The second command will restart it.

How To Restart KDE Plasma 5

To restart the KDE Plasma 5 desktop, press Alt+F2 and enter this command:

kquitapp5 plasmashell && kstart plasmashell

If you are using the plasma 5 / KDE Frameworks 5 and the kstart command is not working, try using kstart5 in place of kstart.

What the Commands Do

The commands in this process offer specific functionality.

What Happens When You Run Killall

The killall command terminates all of the processes associated with the name you give it. For example, if you run three instances of Firefox and execute the following command, then all of the running instances of Firefox terminate:

killall firefox

This technique is useful when you're trying to kill the Plasma desktop because you only want one process running and the killall command will make sure nothing else is running when you issue the subsequent kstart command.

What Happens When You Run KQuitapp5

Discover more information about the kquitapp5 command by running the following in a terminal window:

kquitapp5 -h

The KDE Plasma desktop is d-bus enabled and therefore you can provide the name of the application that runs the Plasma desktop to kquitapp5 to stop it. In the examples above the name of the application is plasmashell.

The kquitapp5 command accepts two switches:

  • --service: Overrides the application name and allows you to specify the full name of the service you wish to stop
  • --path: Allows you to specify the path to the d-bus interface to use.

What Happens When You Run KStart

The kstart command launches applications with special window properties. It also restarts the plasmashell application.

You can, however, use kstart to launch any application and specify different parameters so that the window shows up in a certain way. For example, you can make the window appear on a certain desktop or on all desktops or you can maximise the application, make it full screen, place it on top of other windows, or indeed below other windows.

By using kstart you run the plasma shell as an independent service and it is not linked to the terminal in any way.