In order to invert colours on monitor, I invoke:

xcalib -invert -alter

The problem is, that on Dual-Monitor setup it inverts colors only on first screen.

I can not use Compitz gadgets for color inverting, cause my setup is

  • Two rotated (pivot) Monitors

Dual-Screen when both are Piovot is not working with composing on my card.

Xorg seems only solution.

xcalib is great cause I can switch depending on app, immediately.

Cany suggestions, solutions how to invert colors on both screens with xcalib ?


-screen parameter does not work:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  130 (XFree86-VidModeExtension)
  Minor opcode of failed request:  19 (XF86VidModeGetGammaRampSize)
  Value in failed request:  0x17
  Serial number of failed request:  10
  Current serial number in output stream:  10

Here is my xrandr screen configuration:

~$ xrandr                                                                                                                                                              
Screen 0: minimum 320 x 200, current 2400 x 1920, maximum 3840 x 3840                                                                                                  
DFP1 connected 1200x1920+1200+0 left (normal left inverted right x axis y axis) 518mm x 324mm                                                                          
   1920x1200      60.0*+                                                                                                                                               
   1680x1050      60.0 +                                                                                                                                               
   1440x900       59.9 +                                                                                                                                               
   1280x800       60.0 +                                                                                                                                               
   1920x1080      60.0     50.0     30.0     25.0     24.0                                                                                                             
DFP2 connected 1200x1920+0+0 left (normal left inverted right x axis y axis) 518mm x 324mm                                                                             
   1920x1200      60.0*+                                                                                                                                               
   1920x1080      60.0 +                                                                                                                                               
   1776x1000      60.0 +                                                                                                                                               
   1680x1050      60.0 +                                                                                                                                               
   1440x900       59.9 +                                                                                                                                               
   1280x800       60.0 +   75.0                                                                                                                                        
   1152x648       60.0 +                                                                                                                                               
   1600x1200      60.0                                                                                                                                                 
   1400x1050      60.0                                                                                                                                                 
   1280x1024      75.0     60.0                                                                                                                                        
CRT1 disconnected (normal left inverted right x axis y axis)                                                                                                           
CRT2 disconnected (normal left inverted right x axis y axis)   

As you can see, they are rotated - 1200x1920 setup on one virtual screen with maximum 3840 x 3840. I think, that's reason why it's like "one" screen with 2400x1920, splitted on both (so, xcalib applies only to primary one). But, it's only my hypothesis, maybe reason is different.

6 Answers 6


Here is a small utility program that does what you want:


It works on xorg buy not Wayland.

  • 1
    Please don't just post a link (and useless filler text); include some relevant detail so that there is sufficient context around the answer.
    – jasonwryan
    Nov 5, 2013 at 22:13
  • While @jasonwryan is right about the answer quality, I can confirm xrandr-invert-colors works. It's time to throw the unmaintained xcalib out ot the window and herald the new champion.
    – lkraav
    Feb 7, 2015 at 19:39
  • 1
    @jasonwryan "relevant detail": it works.:) This utility does exactly what OP was asking for. Mar 19, 2015 at 14:54
  • In my opinion short and sweet beats unnecessarily long-winded every day of the week. Jun 12, 2015 at 1:49
  • @Campbell are you familiar with something similar working on Wayland rather than xorg? Feel free to join in.
    – Johan
    Apr 18, 2023 at 7:53

One could try fiddling with negative gamma-values and brightness-values < 1 to generate a negative gamma-ramp on a specific output.

xrandr --output [output] --gamma -0.5:-0.5:-0.5 --brightness 0.1 

this suffices at least to me and works out of the box, but does not take into account any existing gamma-curves for an output. might be worth a shot. Greetings konrad


Try xcalib -d :0 -invert -alter

The -d option refers to the device, and it worked for me when -s didn't

  • In my case it does not help... -d :1 -> Can't open display :1 etc. Nov 24, 2012 at 12:59
  • 1
    -d refers to the display, not the device. BTW, I encountered the same problem and would like to know the solution.
    – Cyker
    Jan 15, 2013 at 1:46

I was experiencing the same issue as the OP. I cloned the repo, installed the one dependency noted in the README, built and installed it, and it works great.

$ git clone https://github.com/zoltanp/xrandr-invert-colors.git
$ apt-get install libxcb-randr0-dev
$ make
$ sudo make install

I took a look at the source code. The bulk of the work is done with a call into the xcb library to set the gamma ramp. The code essentially loops over the number of attached screens, creates a gamma ramp, inverts it, and sets it on that screen. Very simple, and there's no other X program that does this, to my knowledge.

  • Unfortunately, i realized a bit late it does not work with the Wayland windowing system that comes with Debian
    – Johan
    Apr 18, 2023 at 11:19

The manpage indicates that there is a -screen (short -s) parameter. That should do it! Just use two xcalib commands with different -s parameters.

  • 2
    I know this. It does not work. Good you've mentioned about it, I've forgotten. I will update my problem statement. Sep 13, 2011 at 21:06
  • 2
    Your xrandr output says you have the Xorg configured as one screen (only Screen 0 at the top). xcalib interfaces directly with Xorg server, so it can't see more screens. I believe you need to configure multiple Screen sections in your /etc/X11/xorg.conf for this to work properly. Sep 13, 2011 at 21:32
  • Unfortunately , when I do this, pivot on both screens does not work :(. Thank you for hint, now I know where to look for improvement. Sep 13, 2011 at 22:02
  • Did you try Option "Rotate" in your xorg.conf? Or do you need to rotate the screens after X is started? Sep 16, 2011 at 9:41
  • 1
    I'm also looking for a solution, -s 1 doesn't work when dynamically adding screens with --output VGA1 --auto.
    – lkraav
    Jan 2, 2012 at 22:11

I've found that advice :


of using "Desktop Effects" (I have such in KDE), there is one that allows of inverting colours of all screens or just selective windows.

Since on my current hardware Compiz or similar stuff works fine, I can take advantage of such "Desktop Effects". However I wonder, how to use such on other window managers (like fluxbox)... but that's topic for separate question :). (P.S. after taking some look into sources of that effect: kwin/.../invert.cpp it looks like it's just adding hooks for processing windows rendered in separate buffers at it's done in compositing window managers, so maybe only KWin is required, with ability to run with other things than KDE - to be experimented ;) )

You must log in to answer this question.

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