How to restart plasma panel?

I have high load and the Plasma panel doesnt react anymore.

How can I reload just the panel?

This is also related to the proposed change to systemd services instead of whatever is currently done (kstart, xdg, …)

Fedora Kinoite (KDE Atomic) 40, Plasma6

So kill plasmashell from krunner (kickoff didnt work, but krunner did) worked. And through some mechanism plasma automatically restarted too.

It works, but how does it work and is this the best way?

1 Like

The way I do it is plasmashell --replace

2 Likes

I will try that, this launches another instance and kills the old one in some better way right?

I don’t think you can reload only the panel, but reloading plasmashell should be painless. There are a few ways:

  • systemctl restart --user plasma-plasmashell
  • plasmashell --replace
  • kquitapp6 plasmashell (&& plasmashell if it doesn’t restart automatically)
  • killall plasmashell (&& plasmashell if it doesn’t restart automatically)

I prefer using the systemctl method since it deals directly with the service.

8 Likes

systemctl restart --user plasma-plasmashell does not actually reload plasmashell (it doesn’t restart the process at all - same PID before and after).

Your other options work, but they run in terminal foreground, rather than running plasmashell in the background.

I’ve found this to work quite nicely:
kquitapp6 plasmashell || kstart plasmashell

2 Likes

Hi, why would you use || instead of && or simply ; ?

This means it only runs if the previous one failed

1 Like

&& means the second command won’t run if the first failed (which would be the case if plasmashell were not running). I wanted both commands to run no matter what. ; would also work.

EDIT: I think you’re right about only the first command running. Maybe ; is the better option.

3 Likes

If I run that in krunner it works, but in terminal it closes the plasmashell with the terminal

But how do you run the command? In terminal? I am trying to use it with a launcher.

What works for me is running the following from terminal (I’m using KConsole):

kquitapp6 plasmashell; kstart plasmashell
1 Like

It should work in a terminal, in KRunner, and in the menu (which uses the same backend as KRunner for this).

systemctl restart --user plasma-plasmashell

does not work from krunner

kquitapp6 plasmashell; kstart plasmashell

works perfectly from krunner

the same goes for Kickoff (the start menu) too

what would kquitapp do? Is this the “Windows like” “hey program please close if you are ready” way of avoiding errors?

It works here (I tested it before commenting).

I don’t know what Windows thing you’re referring to, but yes.

Looking at src/tools/kquitapp/kquitapp.cpp · master · Frameworks / KDBusAddons · GitLab it seems to just call the quit() D-Bus method of whatever D-Bus enabled process is running. In this case it’s equivalent to calling qdbus6 org.kde.plasmashell /MainApplication quit.

This in turn is probably equivalent to using QCoreApplication::quit() or qApp->exit(), which just terminates the app successfully.

As for what plasmashell --replace does, looking at shell/main.cpp · master · Plasma / Plasma Workspace · GitLab it just seems to use KDBusService::Replace (or maybe KDBusService::Unique), which is implemented in src/kdbusservice.cpp · master · Frameworks / KDBusAddons · GitLab and basically just calls qdbus6 org.kde.plasmashell /MainApplication quit too (then goes on to start the process and register it in D-Bus again elsewhere).

2 Likes

thanks for the in depth answer!

I want to run this as an “application” called Restart Plasma Shell, searchable with the application launcher, and, for that purpose, plasmashell --replace does work:

I’m still in Plasma 5 (kubuntu 24.04 LTS)

The most likely explanation for that behaviour is that you are not on a systemd OS.

if you do have systemd , then just running kquitapp6 plasmashell - with kstart or relaunching plasmashell in another way - would work well because the Plasma shell systemd service will restart it automatically after you cause it to quit.

1 Like

Hi,
at my side, the following options work fine at konsole:

  • With restriction, that plasmashell will be killed if the konsole will be closed
    ** plasmashell --replace
    ** plasmashell restart
  • Works fine, as well the konsole will be closed afterwards
    ** systemctl restart --user plasma-plasmashell
    ** kquitapp6 plasmashell; kstart plasmashell

So the last two options should be preferred

2 Likes