Friday, May 3, 2024
170
rated 0 times [  170] [ 0]  / answers: 1 / hits: 273439  / 1 Year ago, wed, january 11, 2023, 1:45:20

I would like to implement a keyboard shortcut to restart gnome-shell whenever this one crashes (some bugs aren't currently fixed just yet). For this I would need a command line to restart the shell.



The Alt+F2 and restart command won't work when the shell is crashed because the prompt is implemented in the shell.



Hence, how to restart the gnome-shell from command line?


More From » command-line

 Answers
7

GNOME Shell 3.30.1 on Ubuntu 18.10


The command to replace gnome-shell would be sending a SIGQUIT signal to it with:


killall -3 gnome-shell

or:


killall -SIGQUIT gnome-shell

As of GNOME Shell 3.30.1 on Ubuntu 18.10, the solution below no longer works, and will kick the user to the login screen, losing all of their work.


Before GNOME Shell 3.30.1


The command to replace gnome-shell would be:


gnome-shell --replace &

The ampersand is added to return the shell prompt after running the command; pressing Ctrl+C or closing the terminal instead would make the desktop unusable, and require a full restart.


From the manual page of gnome-shell:



-r, --replace
Replace the running window manager

Unsure which version you are using?


The command to check your GNOME Shell version is:


gnome-shell --version

[#40641] Thursday, January 12, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oreera

Total Points: 472
Total Questions: 121
Total Answers: 116

Location: Mayotte
Member since Thu, Dec 17, 2020
3 Years ago
;