воскресенье, 24 февраля 2013 г.

redscale

I heard it is easier to look at red-colored interface. Don't know if it's true, or I just convinced myself, but it's really easier for me to read red text.
One can use
xcalib -invert -alter
to invert all output, but that don't cope with making it red. Fortunately, there is Color filter plugin for compiz that can alter colors both for whole desktop and for selected windows. One can use predefined present or create his own, by writing GL ARB fragment program. Here is one for reverse redscale:
!!ARBfp1.0
TEMP tex;
TEMP tex2;
TEX tex, fragment.texcoord[0], texture[0], RECT;
MOV tex2, {0, 0.0, 0.0, 1.0};
DP3 tex2.r, tex, {0.33333, 0.33333, 0.33333, 0};
ADD tex2.r, 1.0, -tex2.r;
MOV result.color, tex2.rbga;
END
and for redscale
!!ARBfp1.0
TEMP tex;
TEMP tex2;
TEX tex, fragment.texcoord[0], texture[0], RECT;
MOV tex2, {0, 0, 0, 0};
DP3 tex2.r, tex, {0.33333, 0.33333, 0.33333, 0};
MOV result.color, tex2.rbga;
END

Copy text to file, then select it in compiz config. Super-f activates shader for current window, Super-d for whole desktop.