Skip to content

Instantly share code, notes, and snippets.

@linuxoid69
Created May 19, 2019 08:48
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 linuxoid69/930ffcfe112534c5e7ac4e2a8d9c4c36 to your computer and use it in GitHub Desktop.
Save linuxoid69/930ffcfe112534c5e7ac4e2a8d9c4c36 to your computer and use it in GitHub Desktop.
81-backlight.rules
# Adjust screen brightness according to power state
# 1st rule for when on AC
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/YOUR_USERNAME/.Xauthority", RUN+="/usr/bin/brightlight -w 1200"
# 2nd rule for when on battery
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/YOUR_USERNAME/.Xauthority", RUN+="/usr/bin/brightlight -w 350"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment