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

11,224

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.

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

Solution 4

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/

Share:
11,224

Related videos on Youtube

sudcha
Author by

sudcha

Updated on September 18, 2022

Comments

  • sudcha
    sudcha over 1 year

    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.

  • Marco
    Marco over 11 years
    “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.
  • sudcha
    sudcha over 11 years
    @Marco Is it possible to invert a specific application with xcalib? E.g. google-chrome? Or is it only able invert the current monitor?
  • Marco
    Marco over 11 years
    @k0pernikus Unfortunately not, xcalib can only invert the entire screen.
  • sudcha
    sudcha over 11 years
    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?
  • lmat - Reinstate Monica
    lmat - Reinstate Monica over 10 years
    The OP asked about the current window, this inverts all windows on the screen, right ?
  • gcb
    gcb over 10 years
    @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)