Giter Club home page Giter Club logo

xrandr-brightness-script's Introduction

xrandr-brightness-script

Utility script for adjusting the brightness and color temperatures of displays using xrandr.

Especially useful for OLED screens that don't have adjustable hardware backlights.

I recommend binding this script to custom keyboard shortcuts for easy accessibility.

Usage:

You can run brightness.sh to get a usage description and identify connected displays.

$ ./brightness.sh
Usage: brightness.sh op display [stepsize|value] [--temp]

arguments:
  op:             - to decrease or + to increase brightness
                  = to set brightness to a specific value
  display:        name of a connected display to adjust
  stepsize:       size of adjustment step (default 0.1)
  value:          value to set (default 1.0 for brightness, 0.6 for color temperature)
  --temp:         adjusts color temperature instead of brightness

displays:
  eDP1     brightness:  1.0  gamma:  1.0:1.0:1.0  temp:  0.6
  DVI-D-0  brightness:  1.0  gamma:  1.0:1.0:1.0  temp:  0.6
  HDMI-0   brightness:  1.0  gamma:  1.0:1.0:1.0  temp:  0.6

Note: Color temperatures range from 0.0 (warm) to 1.0 (cold) and represent Kelvin values between 3000K and 10000K

Examples:

$ ./brightness.sh + eDP1               Increase brightness of eDP1 display by 0.1
$ ./brightness.sh - eDP1               Decrease brightness of eDP1 display by 0.1

$ ./brightness.sh + eDP1 --temp        Increase color temperature of eDP1 display by 0.1
$ ./brightness.sh - eDP1 --temp        Decrease color temperature of eDP1 display by 0.1

$ ./brightness.sh + eDP1 0.2           Increase brightness of eDP1 display by 0.2
$ ./brightness.sh - eDP1 0.2           Decrease brightness of eDP1 display by 0.2

$ ./brightness.sh + eDP1 0.2 --temp    Increase color temperature of eDP1 display by 0.2
$ ./brightness.sh - eDP1 0.2 --temp    Decrease color temperature of eDP1 display by 0.2

$ ./brightness.sh = eDP1               Reset brightness of eDP1 display to 1.0
$ ./brightness.sh = eDP1 0.5           Set brightness of eDP1 display to 0.5

$ ./brightness.sh = eDP1 --temp        Reset color temperature of eDP1 display to 0.6
$ ./brightness.sh = eDP1 0.4 --temp    Set color temperature of eDP1 display to 0.4

Motivation:

My motivation for creating this little script was a problem my friend was having with his new HP Spectre x360 OLED using Linux. He wasn't able to adjust the display brightness via the designated brightness keys on his keyboard. So I wrote this script for him and thought maybe others with similar problems could profit from me publishing this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.