How to reverse colors for the current window in gnome shell?

Solution 1:

To invert the entire screen you can use the program xcalib:

xcalib -invert -alter

From the xcalib man page

xcalib loads 'vcgt'-tag of ICC profiles to the X-server using the XVidMode Extension in order to calibrate your display.

That means it does not depend on compiz being used.

You can install it using sudo apt-get install xcalib. To make it more convenient assign a keyboard shortcut opening the Keyboard settings.

Keyboard Settings for adding manual shortcut

There, navigate to shortcuts. Add a custom shortcut by pressing the plus button, add the name and the command. It will be disabled by default, so assign a shortcut by clicking on Disabled and perform the wanted shortcut, e.g. meta + i

Before:

before

After xcalib -invert -alter was launched (mapped to <meta-i>:

after

Pressing it again restores to the normal not inverted screen.

Solution 2:

Partial solution

Perhaps, you can use a high / inverse contrast that sort of negates the windows. While this does not work for a browser's web pages (you could use browser specific solutions for that), it generally works for desktop applications.

Go to Universal Access and choose High / Inverse for Contrast. You could know have a white text in black background. While I admit this isn't the best solution, it should help you somewhat if you are desperate.

High Inverse


Making the windows or the screen negative is, unfortunately, a Compiz feature. If I am not wrong, gnome-shell uses Mutter as its window manager and Mutter currently doesn't have any feature that allows the users to negative the windows.

The reason why you were able to make your windows negative in 11.04 or earlier versions were because you were using GNOME classic, which apparently used either Metacity or Compiz as its window manager.

If you really want to make your windows negative, I strongly urge you to use Unity, as it uses Compiz and can easily be configured to make your current window negative.

Or, you can also use gnome-classic in 11.10 and enable Compiz in gnome-classic.

  • How do I enable compiz in Gnome Classic?

Solution 3:

Unless you are willing to write a Gnome-Shell extension, this is not possible.

It also depends on whether Clutter is able to support this feature. You can read about writing Gnome-Shell extensions here:

https://live.gnome.org/GnomeShell/Extensions