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).

  • 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


You need the xcalib package:

xcalib -i -a
  • 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

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
sudo make install

After that inverting colors on the screen is simple as:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.