Skip to content

Instantly share code, notes, and snippets.

@AugustoCalaca
Created December 30, 2019 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AugustoCalaca/86770a2ddabaf88d656c105204c4721f to your computer and use it in GitHub Desktop.
Save AugustoCalaca/86770a2ddabaf88d656c105204c4721f to your computer and use it in GitHub Desktop.
brightness lxde debian 10
#!/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
#!/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