KDE Plasma is one of the very best desktop environments available out there. It’s the most customizable desktop environment I’ve ever used, and possibly the most customizable there is. This is made possible due to KDE Plasma being a modular desktop. Everything from the panel to the icons on it, which are actually widgets, can be fine-tuned to your liking. Not to mention it also supports themes and icon packs like most other desktop environments. All of this comes at a cost though. The Plasma desktop is by no means lightweight and it can be quite a task for an older PC to handle it. Even if you have a fairly powerful PC, sometimes, the KDE Plasma desktop might seem a little slow. Fortunately, it’s easy to restart KDE Plasma desktop without rebooting your computer.
Why should you restart KDE Plasma Shell?
You won’t need to do this often, I’ve barely faced this once and I’ve been using KDE for more than a couple of months. This could happen if you’ve been using KDE on a machine that stays on for long periods of time. Rebooting solves the issue, but this isn’t an issue with the entire operating system. The issue lies with the Plasma desktop and thus restarting it fixes the sluggishness too. Rebooting isn’t very difficult, it is but it takes time. More importantly, it means you have to close everything you’re doing so that the computer can restart. Whereas you can still have all your current work open and running while you simply restart KDE Plasma.
To restart, you will need to use a couple of commands in a Terminal. These commands differ, depending on which version of KDE Plasma you’re using. Furthermore, there are also a couple of ways to restart the Plasma Shell in KDE5. We’ve covered all of that below.
Restart KDE Plasma 4
To do this with the Plasma 4 desktop, launch the Terminal window. This is known as Konsole in KDE. Copy and paste the following two commands in the Konsole one by one and hit enter after each.
killall plasma-desktop kstart plasma-desktop
The killall command kills the desktop while kstart, as you can guess, starts it again.
Restart KDE Plasma 5
On Plasma 5, you can use either the killall command as was the case with the previous KDE versions, or kquitapp5. the command to start the desktop is still the same but the name of the process is a little different.
killall plasmashell kstart plasmashell
Here’s how you can do this using the kquitapp5 command:
kquitapp5 plasmashell kstart5 plasmashell
What do these commands mean?
Now you don’t really need to know this, but if you’re using Linux you’re probably enjoying the learning experience. It’s great to learn things. In that spirit, before using the commands let’s see what the commands actually do. Here’s what they do.
- killall – This command kills all of the processes associated with the name of the process you give it. For instance, if you have 5 instances of Chrome running simultaneously you can use killall chrome. This will call all the running instances of the chrome process. Using killall to kill plasma desktop makes sure that no other instances of it are running but the one you will be starting using the kstart command.
- kquitapp5 – This command takes the name of the application you want to stop. The Plasma desktop is run by an application named plasmashell. So you can use kquitapp5 to stop the application itself, thus killing the desktop out of your system’s memory. You can use the kquitapp5 -h command in a terminal to know more about it.
- kstart – the kstart command is used to launch applications with special properties. You can specify the location of the app window, the size, or whether it should appear on all desktops or just one, etc. There are a number of different parameters you can assign. Clearly, we haven’t done anything like that so why use the kstart command? For the uninitiated, you can also launch apps via the Terminal by simply using their names. For instance, type firefox in a terminal and hit enter. This will launch Firefox if you have it installed. Now close the Terminal but not the Firefox. You’ll notice Firefox closes automatically since it was running on the Terminal as a dependent service. kstart allows you to launch applications as independent services so they won’t close as soon as you close the Terminal.
So, that was how you can restart the KDE plasma desktop without rebooting your machine. Once the Plasma shell is restarted, you should notice the issue you were having resolved.