Gnome3: Disable Hot Corners

Gnome3: Disable Hot Corners

I sincerely hate Hot Corners in Gnome3.  This article will walk you through disabling them, because you probably hate them as much as I do (you’re here right)…

So firstly what are hot corners, and why do I hate them?  Hot corners is the upper left hand corner of your screen (0,0) the idea is that if you move your mouse into the upper left hand corner then you must want the dash to come up.  However it frustrates me, because sometimes when I am typing or cussing or both, I will inadvertently bump my mouse and then I end up in the dash.

The file we need to change is /usr/share/gnome-shell/js/ui/layout.js

Here is the chunk of the file we are interested in:

        this._corner = new Clutter.Rectangle({ name: 'hot-corner',
width: 1,
height: 1,
opacity: 0,
reactive: true });

We want to change that to:

        this._corner = new Clutter.Rectangle({ name: 'hot-corner',
width: 1,
height: 1,
opacity: 0,
reactive: false });

Notice the only change is that we are making this not reactive.

Now after a reboot the hot corners should no longer be an issue.

UPDATE 19 FEB 2013

A little cleaner way to accomplish this same way, without having to open up a text editor would be to use awk…  I find myself doing this often due to updates that overwrite my configuration.

# awk '/this._corner = new Clutter.Rectangle/,/ });/ { sub(/reactive: true/, "reactive: false");} { print }' /usr/share/gnome-shell/js/ui/layout.js > /usr/share/gnome-shell/js/ui/layout.js.tmp; mv /usr/share/gnome-shell/js/ui/layout.js /usr/share/gnome-shell/js/ui/layout.js.orig; mv /usr/share/gnome-shell/js/ui/layout.js.tmp /usr/share/gnome-shell/js/ui/layout.js

Now what exactly are we doing?

Step 1 – Look for a block of text.

Find block starting with “this._corner = new Clutter.Rectangle” and ending with ” });”

Step 2 – Substitute within that block only.

“reactive: true” will become “reactive: false” only within the block.  There are other instances of reactive: true which we don’t want to modify.

Step 3 – Output the modified file into a temporary file.

“> /usr/share/gnome-shell/js/ui/layout.js.tmp”

Step 4 – Rearrange the files

“mv /usr/share/gnome-shell/js/ui/layout.js /usr/share/gnome-shell/js/ui/layout.js.orig; mv /usr/share/gnome-shell/js/ui/layout.js.tmp /usr/share/gnome-shell/js/ui/layout.js”

 

This will leave you with an active configuration which will not have reactive hot corners.

# awk '/this._corner = new Clutter.Rectangle/,/ });/' /usr/share/gnome-shell/js/ui/layout.js
this._corner = new Clutter.Rectangle({ name: 'hot-corner',
width: 1,
height: 1,
opacity: 0,
reactive: false });

As well as a backup of the original configuration file.  That can be put back into service if need be.

# awk '/this._corner = new Clutter.Rectangle/,/ });/' /usr/share/gnome-shell/js/ui/layout.js.orig
this._corner = new Clutter.Rectangle({ name: 'hot-corner',
width: 1,
height: 1,
opacity: 0,
reactive: true });