GithubHelp home page GithubHelp logo

philippnormann / xrandr-brightness-script Goto Github PK

View Code? Open in Web Editor NEW
108.0 4.0 22.0 32 KB

๐Ÿ”† Script for adjusting the brightness and color temperature of displays on a software level using xrandr.

License: GNU General Public License v3.0

Shell 100.00%
xrandr brightness color-temperature utility shell-script linux oled

xrandr-brightness-script's People

Contributors

acn0w avatar indeedwatson avatar jayypluss avatar ngirard avatar philippnormann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

xrandr-brightness-script's Issues

Thank you and suggestions

@philippnormann Thanks for creating a beautiful piece of code. I had an issue with my Lenovo Legion and I used to manually update the brightness. I found this repo while searching for night mode settings using gamma. This script does both of those things. Now I can automate screen settings and key bindings.

Few suggestions, we can an ability to update gamma/temp and brightness with a single command. I am planning to integrate night mode using this repo.

Let me know what you think about it.

Feature Request - Noob

Hi, Thanks a lot for sharing this script. I am trying to control brightness on Ubuntu 18.04, having nvidia 710 graphics card on a desktop.

Is it possible to combine your script with some keyboard shortcut (for ex. ctrl+up, ctrl+dn) to control brightness.

If it is already possible with your script, would you be kind enough and guide on how to achieve it?

Many thanks in advance!
~ajay

Support for multiple displays

Hi,

This is a cool script that does its job, but it's hard coded to the first display found by xrandr. If we provide the second connected display as a second argument, it will still using the brightness value of the first display.

I suggest the following changes, if you like this, please commit:

#!/bin/sh
USAGE() {
echo '#############################################'
echo "Please provide two arguments."
echo "First should be - or +"
echo "Second should be a name of connected display"
echo
echo "Please see the list of connected displays:"
xrandr -q|grep -w connected|awk '{print $1}'
echo '#############################################'
}

if xrandr -q | grep -o $2 &>/dev/null && (($# == 2)) && [[ $1 =~ ^(+|-)$ ]]; then

CURRBRIGHT=$(xrandr -q --verbose|grep -A 5 $2|awk '/Brightness/ {print $NF}')
if [ -z $CURRBRIGHT ]; then
echo "Current brightness for provided display has an empty value. Is this display connected?"
echo "Please see the list of connected displays:"
xrandr -q|grep -w connected|awk '{print $1}'
exit 1
else
if [ "$1" = "+" ] && [ $(echo "$CURRBRIGHT < 1" | bc) -eq 1 ]
then
xrandr --output $2 --brightness $(echo "$CURRBRIGHT + 0.1" | bc)
elif [ "$1" = "-" ] && [ $(echo "$CURRBRIGHT > 0" | bc) -eq 1 ]
then
xrandr --output $2 --brightness $(echo "$CURRBRIGHT - 0.1" | bc)
fi
fi
else
USAGE
fi

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.