15

Is there a way to invert colors in X. It would be even more useful if the answer was something I could bind to a keyboard shortcut(a command and not a setting that will require a restart if X).

2
  • why do you want to do this?
    – akira
    Nov 9, 2010 at 0:10
  • 2
    i binded that to <C-M-i> so when i can read large texts on firefox or any other program whose colors i canot invert more easily :)
    – fakedrake
    Dec 19, 2010 at 10:23

2 Answers 2

20

You need the xcalib package:

xcalib -i -a
3
  • Unfortunately, this only inverts the colors on one display.
    – Artefacto
    Feb 15, 2013 at 13:04
  • 1
    xcalib supports the -s, -screen option that may be useful.
    – cYrus
    Feb 15, 2013 at 15:56
  • And to revert the inversion, just repeat the very same command.
    – Joachim W
    Mar 21, 2019 at 9:50
2

If you are like me and you have tried xcalib but you have encountered an error like this on debian:

xcalib: unsupported ramp size

Then you could use an alternative like: xrandr-invert-colors.

First clone the repository

git clone "https://github.com/zoltanp/xrandr-invert-colors.git"

After that you can install the build-essential package and you can compile the code with that commands:

sudo make deps-apt
make
sudo make install

After that inverting colors on the screen is simple as:

xrandr-invert-colors

You must log in to answer this question.

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