Created
May 31, 2019 08:02
-
-
Save Steffo99/6dca64b58c72079474afd8d2a6e96e6d to your computer and use it in GitHub Desktop.
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
| #!/bin/bash | |
| MAX_BRIGHTNESS=$(cat /sys/class/backlight/nvidia_0/max_brightness) | |
| if [[ $1 -lt 0 ]]; then | |
| echo "Error: brightness must be in range [0-$MAX_BRIGHTNESS]" | |
| exit 1 | |
| elif [[ $1 -gt $MAX_BRIGHTNESS ]]; then | |
| echo "Error: brightness must be in range [0-$MAX_BRIGHTNESS]" | |
| exit 2 | |
| fi | |
| echo $1 > /sys/class/backlight/nvidia_0/brightness |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment