Created
          April 21, 2017 22:00 
        
      - 
      
- 
        Save alisinabh/9b0508e995431bb32be696663815be39 to your computer and use it in GitHub Desktop. 
    X window selective brightness control - using Xrandr and awk
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | BRIGHTNESS=`xrandr --verbose | grep -i brightness | cut -f2 -d ' ' | head -n1` | |
| NEW_BRIGHTNESS=`awk '{print $1-$2}' <<<"$BRIGHTNESS 0.05"` | |
| echo $NEW_BRIGHTNESS | |
| xrandr --output DVI-I-1 --brightness $NEW_BRIGHTNESS | |
| xrandr --output DVI-I-2 --brightness $NEW_BRIGHTNESS | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | BRIGHTNESS=`xrandr --verbose | grep -i brightness | cut -f2 -d ' ' | head -n1` | |
| NEW_BRIGHTNESS=`awk '{print $1+$2}' <<<"$BRIGHTNESS 0.05"` | |
| echo $NEW_BRIGHTNESS | |
| xrandr --output DVI-I-1 --brightness $NEW_BRIGHTNESS | |
| xrandr --output DVI-I-2 --brightness $NEW_BRIGHTNESS | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | xrandr --output DVI-I-1 --brightness 1 | |
| xrandr --output DVI-I-2 --brightness 1 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment