OpenICC / xcalib

Load 'vcgt'-tag of ICC profiles to X-server and MS-Windows. Works on calibration stage, which can be a precondition for display ICC color conversions.
Other
67 stars 12 forks source link

Use case examples for xcalib #5

Open rthardy opened 6 years ago

rthardy commented 6 years ago

I have one. I have a laptop that rides around in my car with me, and I like to use a high gamma to help deal with impinging skylight. At night, I use an inverted display to minimize total light output so my eyes can remain dark-adapted. I have a panel button that triggers a script to make the changes:

#!/bin/bash
if test -f ~/.altered-display; then
    xcalib -c;
    if test -f ~/.inverted-display; then              #normal display
        rm ~/.altered-display ~/.inverted-display;
    else                                  #nighttime inverted display
        xcalib -red 0.7 0 100 -green 0.7 0 80 -blue 0.7 0 59 -i -a;
        mv ~/.altered-display ~/.inverted-display;
    fi
else
    if test -f ~/.inverted-display; then
        xcalib -co 60 -a;             #nighttime away from city lights
    else
        xcalib -gc 2.2 -a;            #high gamma for incident sunlight
    fi;
    touch ~/.altered-display;
fi;

I also like to see the gamma ramps on occasion. This works-for-me:

xcalib -p -a | grep ^[0-9] | graph -a -T X -x 0 3071 -y 0 65535 -m 0 -X "$(xcalib -l -a | tail -n 1)"
blairdrummond commented 5 years ago

I use this to create a bunch of "themes" which I can select with rofi. It can be easily edited to work with dmenu.

#!/bin/sh

list () {

    echo "clear     : -red 1.0  0 100 -green 1.0  0 100 -blue 1.0  0 100"
    echo "lightgray : -red 1.0 25 100 -green 1.0 25 100 -blue 1.0 25 100 -invert"
    echo "darkgray  : -red 1.0 10 100 -green 1.0 17 100 -blue 1.0 18 100 -invert"
    echo "lightblue : -red 1.5  0 100 -green 1.5 10 100 -blue 1.5 50 100"
    echo "purple    : -red 0.7 35 100 -green 0.7 27 100 -blue 0.7 45 100 -invert"
    echo "aqua      : -red 1.0 12 100 -green 1.0 29 100 -blue 1.0 30 100 -invert"
    echo "gray      : -red 0.9 28  90 -green 1.0 33 100 -blue 1.0 43 100 -invert"
    echo "blue      : -red 0.7  0 100 -green 0.7 10 100 -blue 0.7 50 100 -invert"
    echo "brown     : -red 1.0 17 100 -green 1.0  0 100 -blue 0.9  0 100 -invert"
    echo "black     : -red 1.0  0 100 -green 1.0  0 100 -blue 1.0  0 100 -invert"
    echo "retro     : -red 1.0  0   1 -green 1.0  0 100 -blue 1.0  0   1 -invert"
    echo "zenburn   : -red 0.5  0 100 -green 0.5  0 100 -blue 1.0  0   1 -invert"

}

sel=$(list | rofi -dmenu -p theme)
test -n "$sel" || exit 0

xcalib -clear
xcalib -alter $(echo $sel | awk '{$1=$2=""; print}')
rthardy commented 5 years ago

I remember that. Reddit, about a year ago, I think. I'd gone searching for 'xcalib' on /r/UnixPorn/ to see if anyone else might be using it. So, does 'rofi' or 'dmenu' get along with a window manager like 'kwin'? I've never used either one of them.

blairdrummond commented 5 years ago

Yep, I wrote that post about a year ago, just logged back in the other day and saw your comment. And dmenu and rofi tend to be very friendly to all window managers that I've used.