I want to restart the Gnome Shell from within a script I’m working on.
While researching how other applications do this, I saw they use the dbus message system to communicate with the Shell using the following message : busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")'.
However, when executing this from either the terminal or from the script it does not restart the shell and just returns bs false "", which is the expected response unless unsafe mode is on.
Other strategies I found in the internet that try to restart the Shell externally like killall -HUP gnome-shell are buggy and workflow breaking.
Is there any “official” way to trigger a shell restart programmatically?
What I’m really trying to do is to enable extensions after a manual installation (downloading and extracting it in the extensions folder), but the EnableExtension call does not enable it unless a restart is performed before.
Digging through the shell source code makes me suspect that the problem stems fromMain.extensionManager.loadExtension(extension)not being called when sending EnableExtension message through dbus.
Is that expected behavior or could it be considered a bug?