Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use case examples for xcalib #5

Open
rthardy opened this issue Feb 18, 2018 · 3 comments
Open

Use case examples for xcalib #5

rthardy opened this issue Feb 18, 2018 · 3 comments

Comments

@rthardy
Copy link
Contributor

rthardy commented Feb 18, 2018

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
Copy link

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
Copy link
Contributor Author

rthardy commented Apr 7, 2019

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants