Created
December 30, 2019 00:00
-
-
Save AugustoCalaca/86770a2ddabaf88d656c105204c4721f to your computer and use it in GitHub Desktop.
brightness lxde debian 10
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/sh | |
# create the file brightnessDown.sh and run | |
# chmod a+x brightnessDown.sh | |
ACTUAL=$(xrandr --verbose | grep -i brightness | cut -f2 -d ' ' | head -n1); | |
echo "$ACTUAL"; | |
RESULT="$ACTUAL"-0.1; | |
NEW_VALUE=$(echo "$RESULT" | bc); | |
RESULT=$(echo "0$NEW_VALUE"); | |
echo "$RESULT"; | |
# to get your connected monitor run | |
# xrandr -q | grep connected | |
# and replace the return by 'eDP-1' | |
xrandr --output eDP-1 --brightness $RESULT | |
# put on your .config/openbox/lxde-rc.xml | |
# | |
# <keybind key="XF86MonBrightnessDown"> | |
# <action name="Execute"> | |
# <command>~/brightnessDown.sh</command> | |
# </action> | |
# </keybind> | |
# | |
# openbox --reconfigure |
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/sh | |
# create the file brightnessUp.sh and run | |
# chmod a+x brightnessUp.sh | |
ACTUAL=$(xrandr --verbose | grep -i brightness | cut -f2 -d ' ' | head -n1); | |
echo "$ACTUAL"; | |
comp=${ACTUAL%.*}; # Converts float to integer | |
if [ "$comp" -ge 1 ]; then | |
echo "max brightness"; | |
return 0; | |
fi | |
RESULT="$ACTUAL"+0.1; | |
NEW_VALUE=$(echo "$RESULT" | bc); | |
RESULT=$(echo "0$NEW_VALUE"); | |
echo "$RESULT"; | |
# to get your monitor 'eDP-1' run | |
# xrandr -q | grep connected | |
# and replace the return by 'eDP-1' | |
xrandr --output eDP-1 --brightness $RESULT | |
# put on your .config/openbox/lxde-rc.xml | |
# | |
# <keybind key="XF86MonBrightnessUp"> | |
# <action name="Execute"> | |
# <command>~/brightnessUp.sh</command> | |
# </action> | |
# </keybind> | |
# | |
# openbox --reconfigure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment