Skip to content

Instantly share code, notes, and snippets.

@vain
Created April 28, 2011 19:37
Show Gist options
  • Save vain/947142 to your computer and use it in GitHub Desktop.
Save vain/947142 to your computer and use it in GitHub Desktop.
Control the backlight of an Intel GMA 3150.
#!/bin/bash
current=$(sudo setpci -s 00:02.0 F4.B)
current=$((0x$current))
if [[ "$1" == "up" ]]
then
((current+=0x10))
else
((current-=0x10))
fi
if (( current < 5 ))
then
current=5
elif (( current > 255 ))
then
current=255
fi
sudo setpci -s 00:02.0 F4.B=$(printf "%02X" $current)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment