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
  • 68,507
k0pernikus
  • 6,115

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,115
Marco
  • 1,012
  • 4
    I have a dual monitor setup and xcalib only inverts one screen. Do you know how to invert both at once, or how to specify which one to invert? – k0pernikus Sep 14 '12 at 08:34
  • 2
    The OP asked about the current window, this inverts all windows on the screen, right ? – lmat - Reinstate Monica Sep 06 '13 at 19:01
  • @k0pernikus this is probably another question, but the answer: sometimes Xorg creates a new screen from each monitor. so just pass -d :0 and -d :1 or whatever you have running (may be -d :0.1 also) – gcb Oct 27 '13 at 00:45
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,320
  • 7
    “Making the windows or the screen negative is, unfortunately, a Compiz feature.” This is not true. Inverting using xcalib -invert -alter works perfectly and I don't use compiz. – Marco Sep 06 '12 at 12:29
  • @Marco Is it possible to invert a specific application with xcalib? E.g. google-chrome? Or is it only able invert the current monitor? – k0pernikus Sep 06 '12 at 12:39
  • 1
    @k0pernikus Unfortunately not, xcalib can only invert the entire screen. – Marco Sep 06 '12 at 13:03
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,541
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
  • 2
  • In order to install from that site, I first had to navigate to Installed extensions and follow the instructions to add the Firefox plugin. The native host plugin was (apparently) already installed. Then, I had to reload the page you linked to. Obviously, only follow these instructions if you trust gnome.org. – jpaugh Feb 01 '24 at 01:56