Skip to content

Instantly share code, notes, and snippets.

@alexciarlillo
Created July 12, 2012 11:11
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 alexciarlillo/3097481 to your computer and use it in GitHub Desktop.
Save alexciarlillo/3097481 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
POWER_CHECK=/sys/class/power_supply/AC/online
# set screen brightness
echo 10 > /sys/class/backlight/acpi_video0/brightness
chown ciarlill /sys/kernel/debug/vgaswitcheroo/switch
# set active card based on power state
grep -q "1" $POWER_CHECK
if [ "$?" -eq "0" ]; then
/usr/bin/envy-video ac-on boot
else
/usr/bin/envy-video ac-off boot
fi
# set auto power management
echo auto > /sys/class/drm/card0/device/power_profile
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment