5

What's the easiest way to invert colors on Ubuntu 18.04 Bionic Beaver on the display output?

2
  • 3
    One way is to install xcalib and to use xcalib -i. If you have Intel graphics and encounter the "unsupported ramp ..." error, Anwar's fix may help.
    – DK Bose
    Oct 27, 2018 at 11:45
  • Tom Brossman says and I agree " It's not explicitly clear from OP's question, but I am pretty sure they are asking how to invert colors for the display output, and not an individual JPEG file like in your answer. "
    – Vijay
    Oct 28, 2018 at 19:47

1 Answer 1

9

As DK Bose notes, you could use xcalib -invert -alter, but this will only affect your main monitor if you use more than one. Instead, you could try this program from Zoltan Padrah, which was appears to have been created specifically as a workaround for this problem.

git clone https://github.com/zoltanp/xrandr-invert-colors.git
cd xrandr-invert-colors
 # install dependency libxcb-randr0-dev :
sudo make deps-apt
make
sudo make install

... and run with /usr/local/bin/xrandr-invert-colors.

Note that the sudo make install step is optional; you could just run the xrandr-invert-colors.bin executable directly from the source dir.

Set a keyboard shortcut for this however you like (say, with Settings > Keyboard).

Since this works by adjusting the color output, it can be undone by, e.g., Ubuntu 18's built-in redshift/f.lux analog, which periodically readjusts your colors, so be sure that "Night Light" is disabled in Settings > Display.

Edit: In Ubuntu 19.04 and maybe 20 too, there's a Gnome Shell extension "InvertDE" which is a thin wrapper around xcalib that might be of use. Since I have my own xcalib script at this point, I'm not using it. Additionally, there's the extension "Invert Window Color" that applies to individual windows.

Edit five months later: I've reinstalled to 20.04, and found that @Xaser is indeed right, and xcalib by itself works for me. It might also be that I now have two equal-shape monitors. I'll be using that, or the "InvertDE" extension method for now, as the least custom. But will certainly leave the other stuff here.

1
  • 1
    for me xcalib affects both monitors.
    – Xaser
    Feb 13, 2020 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .