Add a simple restart Gnome Shell script to your right-click menu

After using the behated Unity for too much time I decided to give Gnome3.2 another chance; last time I tried I couldn’t get my cheap integrated Radeon 3000 graphic card to work with all the rendering gnome-shell requires, so I had to pick one of Gnome “classic” or Unity2D. The latter is a little less ugly, albeit suffering from too much rigidity in what you can customize and what you cannot. I tried to like it, I really did, but working with the left dash bar is painful to me.

So, after installing the latest catalyst drivers (12.1) from ATI I’ve been able to use Gnome3, and after tweaking it hard with several extensions (nice system, by the way, but maybe support for browsers other than firefox would help) I now have a desktop that I kinda like. It’s sad that I used to like Gnome2 better, though.

Not speaking of its slow responsiveness (I admit my GPU is no monster, but my PC is 10 months old, so I’d expect it to run whatever window manager… heck, it runs KDE 4 just fine!), what I find astonishing is its instability. Every now and again, gnome-shell screws up for whatever reason, and all window controls are gone, top bar and the gnome-shell itself as well. Switching to another tty with Ctrl+Alt+F1 and logging in with my user to killall gnome-shell is not helping since the gnome-shell process lies in the other session that I’m therefore forced to kill, restarting the gdm process.

At first I used this little hack from phreaknerd’s blog: you schedule a script for automatic execution that checks whether a “delete me if you want to restart gnome-shell” file exists every 15 seconds (so the routine was like: gnome-shell dies, switch to tty1, login, rm polled file, logout, Ctrl+Alt+F7 back to graphic session, wait for the script to find out).

But then I grew tired of waiting the 7.5 seconds (on average :P) for the script to detect that the control file is missing, and of the whole tty switching in general; since I’m always able to right-click on the desktop (if anything on the empty space left by the gone window decorations) I think a better solution is to add a simple script to ~/.gnome2/nautilus-scripts/ (why is it still called gnome2 anyway) like this:

cd ~/.gnome2/nautilus-scripts/; echo -e '#!/bin/bash'"\n"'gnome-shell --replace' > Restart\ gnome-shell; chmod a+x Restart\ gnome-shell

So now all I have to do is right click somewhere on the desktop, choose Scripts/Restart gnome-shell and I can get back to work! 😀

I really, really, really hope that 3.4 will be a lot more stable though…

Advertisements

6 thoughts on “Add a simple restart Gnome Shell script to your right-click menu

    • provided that it works, yes, of course. Most of the times, however, when gnome-shell breaks alt-F2 breaks as well so you have to rely on something external

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s