23

I dislike that most websites use a black font on white background for their sites, as it gets too tiresome for me to read.

Back in the days of 11.04, using Gnome2 with compiz, there actually was a Negative feature that could negate the content of any window, making the background black and the font white. Much easier on the eyes for me.

Yet since 11.10, using gnome shell with mutter, I have no idea if there is something alike out there.

Hence my question: How do I negate the currently active window in gnome shell?

I am not interested in alternative methods, e.g. user styles. I am aware of their existence but I find it much easier to just invert the screen by the hit of a key shortcut. I also want the solution to be application-agnostic. As I also from time to time would want to invert libre-office or some other glaringly white application.

pomsky
  • 70,557
k0pernikus
  • 6,336

5 Answers5

24

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.

k0pernikus
  • 6,336
Marco
  • 1,032
7

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.

jokerdino
  • 41,732
4

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

RolandiXor
  • 51,797
1

This is a beautiful question which I asked myself multiple times since gnome2.

Here is a gnome extension which allows shading of inactive windows. The trick is to activate another window while reading in the shaded one. https://extensions.gnome.org/extension/650/shade-inactive-windows/

Btw: redshift is also a great tool for keeping your eyes calm.

Edit: Now I have created my own first extension. It shades the whole desktop with a panel button click. By scrolling over the button, the brightness can be customized. It is called "Dim Desktop 70" and is available under https://extensions.gnome.org/extension/1130/dim-desktop-70/

domih
  • 265
0

This wonderful Gnome Shell extension do the job:

https://extensions.gnome.org/extension/1041/invert-window-color/

and once installed you only use Super+i to invert 100% colors on the window currently focused!

caos30
  • 1