Created
February 13, 2020 17:47
-
-
Save lurwas/985fbe43900fbf2b7dba7208bfed208f to your computer and use it in GitHub Desktop.
Adjust Oled brightness settings for Dell XPS 7590 (intel drivers)
This file contains 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
.45 |
This file contains 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 | |
BRIGHT=`cat brightness.txt` | |
if [ "$1" = '+' ]; then | |
echo "+" | |
NEWBRIGHT=$(echo "$BRIGHT + 0.05" | bc) | |
if [ "$(echo "$NEWBRIGHT > 1.0" | bc)" -eq 1 ]; then | |
NEWBRIGHT='1.0' | |
fi | |
elif [ "$1" = '-' ]; then | |
echo "-" | |
NEWBRIGHT=$(echo "$BRIGHT - 0.05" | bc) | |
if [ "$(echo "$NEWBRIGHT < 0.0" | bc)" -eq 1 ]; then | |
NEWBRIGHT='0.0' | |
fi | |
fi | |
echo "${NEWBRIGHT}" | |
`xrandr --output eDP-1 --brightness $NEWBRIGHT` | |
echo "$NEWBRIGHT" > brightness.txt |
This file contains 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
From i3wm config file: | |
" | |
... | |
# Sreen brightness controls | |
bindsym XF86MonBrightnessUp exec "~/bin/i3-brightness.sh +" | |
bindsym XF86MonBrightnessDown exec "~/bin/i3-brightness.sh -" | |
... | |
" | |
In your home /bin folder (i3-brightness.sh): | |
#!/bin/bash | |
BRIGHT=`cat brightness.txt` | |
if [ "$1" = '+' ]; then | |
echo "+" | |
NEWBRIGHT=$(echo "$BRIGHT + 0.05" | bc) | |
if [ "$(echo "$NEWBRIGHT > 1.0" | bc)" -eq 1 ]; then | |
NEWBRIGHT='1.0' | |
fi | |
elif [ "$1" = '-' ]; then | |
echo "-" | |
NEWBRIGHT=$(echo "$BRIGHT - 0.05" | bc) | |
if [ "$(echo "$NEWBRIGHT < 0.0" | bc)" -eq 1 ]; then | |
NEWBRIGHT='0.0' | |
fi | |
fi | |
echo "${NEWBRIGHT}" | |
`xrandr --output eDP-1 --brightness $NEWBRIGHT` | |
echo "$NEWBRIGHT" > brightness.txt | |
Before running the first time: | |
cd ~/bin/ | |
echo .45 >> brightness.txt | |
Restart i3wm | |
You should not be able to adjust screen brightness with your funciton keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment