If Plasma dies, here’s what to do

Posted on January 11, 2010, under GNU/Linux.

Every now and then, the Plasma desktop in KDE 4 crashes on me. Usually, it restarts itself. Sometimes, it doesn’t.

If you’re cursed with the latter scenario, there’s an easy solution.

Note: As avocadohead kindly mentioned in the comments, KDE >= 4.3 has renamed “plasma” to “plasma-desktop”. So if you’re using KDE 4.3 or later, replace “plasma” with “plasma-desktop” in the commands below.

By default, KDE sets the keyboard shortcut for “Run Command” to ALT+F2. So hit ALT+F2, and type this, and hit enter:

kbuildsycoca4 && kquitapp plasma && kstart plasma

Plasma should pop back to life.

That command is actually three commands:

  1. kbuildsycoca4 rebuilds KDE’s system configuration cache.
  2. kquitapp plasma ensures that Plasma’s no longer running, instead of just, say, hung.
  3. kstart plasma starts Plasma.

It took me a while to figure this out. Thanks to this post, I learned about kstart. From what I’ve read, it seems that running kquitapp plasma and kstart plasma from the CLI works for some people. Unfortunately, they fail for me on the CLI:

[nickh@chameleon ~] kquitapp plasma
<unknown program name>(7282)/: "Application plasma could not be found using service org.kde.plasma and path /MainApplication."
[nickh@chameleon ~]
[nickh@chameleon ~] kstart plasma
Qt: Session management error: Could not open network socket
kstart(7394) main: Omitting both --window and --windowclass arguments is not recommended
[nickh@chameleon ~] <unknown program name>(7397)/ checkComposite: Plasma has an argb visual 0x9ca7300 71303169
<unknown program name>(7397)/ checkComposite: Plasma can use COMPOSITE for effects on 0x9ca6c18
plasma(7398): KUniqueApplication: Cannot find the D-Bus session server

plasma(7397): KUniqueApplication: Pipe closed unexpectedly.

[nickh@chameleon ~]
Share and Enjoy:
  • Twitter
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Print

4 Replies to "If Plasma dies, here’s what to do"

gravatar

A  on March 30, 2010

I use Ubuntu and I would have to replace “plasma” with “plasma-desktop”. However, I still get the problem you are mentioning: kquitapp plasma or kquitapp plasma-desktop don’t do the trick.

Instead, I used

ps xa | grep plasma

to get the PID of the running plasma-desktop instance, I stopped it with

kill -15 $pid

and restarted plasma-desktop with

kstart plasma-desktop

Hope this helps.

gravatar

nick  on March 30, 2010

Thanks for the alternative solution, mate.

I’m guessing that you ran kbuildsycoca before kquitapp.

Another tool that you could use is pkill. It’d negate the need to search for plasma-desktop’s PID. Eg: pkill -TERM plasma-desktop

gravatar

avocadohead  on May 17, 2010

plasma-desktop has replaced plasma in KDE>=4.3 (distro-independent). As you were so kind to refer to our blog :-) – we had to migrate to a more PC URL, so the new post address would be: http://eumenidae.blogspot.com/2008/12/kill-and-restart-plasma.html

gravatar

nick  on May 17, 2010

I’ve updated the post to mention “plasma-desktop”. Thanks for pointing that out, avocadohead, and also for the new URL to your post.

Leave a Comment