Desktop environment KDE Plasma 5 is solid as a rock at this point, and rarely has last-minute problems that make desktop use impossible. However, sometimes, this panel can freeze and lock. Which is a big problem.
Unlike Gnome Shell, KDE Plasma 5 does not have a real built-in reset mechanism for its users to take advantage of. Therefore, if you are using KDE and want a quick way to restart the locked panel, you will need to create your solution. So, in this little guide we will see how to create a reset tool that can get you out of this jam if your panel fails.
Restart the KDE Plasma 5 panel with terminal commands
This panel is part of the "plasmashell" process, which runs in the background on your Linux computer. So, if you have problems with the panel that does not work, the easiest way to put it back into operation is to deal with this process.
Unfortunately, it is not possible to directly restart the plasmashell process from the command line. Instead, you must do it manually. The best way to do this is with the killall command. Since it will instantly stop every instance of “plasmashell” in execution. Then, open a terminal by pressing CTRL + ALT + T, or CTRL + SHIFT + T on the keyboard and end with “plasmashell”.
Similarly, when executing the killall command, everything will turn black. However, you must still have access to the terminal. From here, restart the “plasmashell” process from the terminal. Be sure to add the “&” symbol at the end of the command to send it to the bottom.
When executing the killall command, everything will turn black. However, you must still have access to the terminal. From here, restart the «plasmashell» process from the terminal. Be sure to add the "&" at the end of the command to send it to the bottom.
Also, as soon as the previous plasmashell command is executed, a new KDE Plasma 5 panel will appear on the screen. However, this new panel depends on the terminal, since it runs inside it. From here, the process must be sent to the background. So, to do that, you must execute the disown command.
Similarly, disown will take the "plasmashell" process and send it to the background. Providing you with a fully functional panel once again.
Create a restart script
To start, opening a terminal to kill the "plasmashell" process can be very tedious. It works in a hurry, but it is not ideal for most users. So, an excellent way to restart the panel if it freezes is to create a quick restart script. Which you can execute.
To start, open a terminal window by pressing CTRL + ALT + T, or CTRL + SHIFT + T on the keyboard. From there, you must follow the step-by-step instructions that we give you below.
1.- With the touch command, create a new blank file in your home directory with the label “panel-restart”.
2.- Use the “echo” command below to add a shebang to the top of the script. In turn, this command is critical because without it, your Linux system will not know how to interpret the restart script.
echo ‘#! / bin / bash’> panel-restart
3.- Execute another echo command to add the main code to the panel reset script.
echo ‘killall plasmashell; plasmashell & ’>> panel-restart
4.- Update the permissions of the restart file using the chmod command. This so that it can run as a program on your computer with Linux.
sudo chmod + x panel-restart
5.- Place the panel reset file inside / usr / bin / with the mv command. Similarly, putting the file here will allow you to call it as a command, just like any other Linux program.
sudo mv panel-restart / usr / bin /
Now, close the terminal window. Then, you must go to the KDE desktop and press ALT + F2 to open the Plasma quick start window. Then, in the window, enter the command below to instantly restart the KDE Plasma 5 panel. Using the script you just did.
Also, when executing the command, your panel should be ready to use.
Add the script to a shortcut
If you want to restart the KDE Plasma 5 panel by pressing a few keyboard buttons, you must configure a custom keyboard shortcut. To do this, you must follow the step-by-step instructions shown below.
1.- First, you must open the application menu, you must search for “custom shortcuts” and open the item shown with that name.
2.- Within the KDE custom shortcut window, search for “Edit”. And click with the mouse. Then, select "New," followed by "Global Shortcut" and "Command / URL."
3.- In the “Comment” area, write something like “KDE panel reset”.
4.- Now, click on “Activate” and assign the new personalized shortcut to your favorite key combination. If you can't figure out what trigger action to use, consider trying CTRL + `.
5.- Select “Action” and type the panel reset command in the “Command / URL” box.
6.- In the same way, click on “Apply”, so that the changes are executed to your Linux computer.
Finally, close the custom shortcut window. Then, press your keyboard combination to restart the KDE Plasma 5 panel instantly.