1

I have a couple of scripts to work around Gnome Shell's inability to work well automatically when swapping between FHD (1080p) and UHD (4k) screens. I set various things with gsettings, restart nemo, but the final bit of the puzzle is how to restart gnome-shell.

If I do gnome-shell -r from my script then that process then owns gnome-shell, so I can't close the terminal without it killing the shell. Doh!

Is there a way to tell Gnome to restart itself and carry on running separately from the process that requested the restart?

artfulrobot
  • 8,543

1 Answers1

3

You can do in your script or in your terminal:

gnome-shell -r &
disown

This will start the program in background from the terminal and disowns the task then.

NOTE: The disown command has to come directly behind the command which starts something in background, otherwise it will not work.

Or if you already have started the program you want to detach from the terminal without the & you can press ctrl+d and type after that:

bg
disown

This will run the task again in background and then detach it from terminal.

Videonauth
  • 33,355
  • 17
  • 105
  • 120