9

I ran xkill to force quit Chrome, and I clicked my desktop. The icons disappeared.

Is there a command that will get them back? I'd rather not restart.

I'm using GNOME and GDM.

Tim
  • 32,274
  • 27
  • 118
  • 177

4 Answers4

11

The desktop icons are managed by file browser, on regular running try

$ ps ax | grep nautilus
 2464 ?        Sl     0:11 nautilus -n
 6390 pts/2    S+     0:00 grep --color=auto nautilus

From man nautilus

   -n
   --no-default-window
          Only create windows for explicitly specified URIs.

In this mode nautilus will not show a window, and it run like a daemon. So for you case use:

nautilus -n & disown
kos
  • 35,535
  • 13
  • 101
  • 151
user.dz
  • 47,137
  • 13
  • 140
  • 258
  • 1
    In Unity instead of Gnome Desktop, it also works without the `-n` flag and opening a normal Nautilus window just starts the separate daemon in background as well. – Byte Commander Dec 08 '15 at 12:50
9

It turns out this can be fixed with Gnome Tweak Tool.

Using xkill on the desktop sometimes turns off the "Icons on Desktop" setting:

Turning this back on fixed it:

If the setting is not turned off, then just turning it off and on again brings them back.

My pronouns are He / Him

Tim
  • 32,274
  • 27
  • 118
  • 177
  • Wut ? `xkill` toggles show icons settings ? That's quite weird. Desktop should be managed by file browser not `gsettings` . . . Or maybe Gnome is just werid – Sergiy Kolodyazhnyy Dec 05 '15 at 19:40
  • @Serg I guess it's weird :p – Tim Dec 05 '15 at 19:40
  • 1
    @Serg, this should work too, as all it does it stops `nautilus -n` which is running in the background when off, and launch it if is on. this handled by `gnome-settings-daemon` or `unity-settings-daemon`. – user.dz Dec 05 '15 at 20:42
2

All you have to do is open Nautilus and all will be back.

Tim
  • 32,274
  • 27
  • 118
  • 177
Doug
  • 41
  • 1
  • 1
    That does not work. – Tim Dec 05 '15 at 20:54
  • 1
    I don't know how this is on Gnome, but simply launching **Nautilus** from the launcher or `nautilus & disown` from the terminal solves this problem perfectly well on Unity! @Sneetsher and @Tim – Byte Commander Dec 08 '15 at 12:49
  • @ByteCommander , Excuse me Doug you deserve my up vote. I judged your answer on my own experience using an older release, However *I confirm that your answer work as supposed on **Ubuntu 15.10 for both Unity & Gnome Shell***. Thank you ByteCommander for correcting me. – user.dz Dec 09 '15 at 00:24
  • @Tim , Could you please review this because it seems to depend on the release. If you can mention here in a comment in which release did not work for you. It will be helpful for other users as the question is not for specific release, I think it does not deserve a down vote at least . – user.dz Dec 09 '15 at 00:34
  • @sne the question says gnome, do you mean version? – Tim Dec 09 '15 at 09:53
  • @tim yes i mean the gnome version – user.dz Dec 09 '15 at 10:57
  • @Sneetsher I don't know that. I think this *does* deserve my downvote because this didn't work for me... If you hover over the downvote it says "This answer is not useful" - well, for me, it isn't. – Tim Dec 09 '15 at 10:58
  • @Tim yes i agree, it is ok, but could you please let me know your version of Gnome? – user.dz Dec 09 '15 at 11:01
  • @Sneetsher At college right now, and I'm not sure. Will try to find out at home later (around 6 pm UTC) – Tim Dec 09 '15 at 11:15
  • @Tim it depends on whether you are using nautilus to draw the desktop. In any case, this is basically the same as the answer you accepted and also what your answer is doing in the background. – terdon Dec 09 '15 at 12:03
  • @terdon all I know is this didn't get the icons back. – Tim Dec 09 '15 at 12:04
0

The previous answers did not work for me, but this command does for Kubuntu 18.04

kstart plasmashell

I hope this could helps others!

Jason Angel
  • 101
  • 1