Richardcavell
May 24th, 2009, 01:30 AM
Hi,
I'm using Ubuntu 9.04 on the third partition of my Intel Macbook2,1. I want to run the following command *as root* every time Ubuntu loads:
xrandr --output LVDS --set BACKLIGHT_CONTROL combination
This command fixes the backlight brightness controls for Macbooks. It doesn't work if it's not root. If I type 'sudo' plus the command within a terminal, it works perfectly. But I want it to run automatically.
So I tried this: My /etc/rc.local now reads as follows:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
xrandr --output LVDS --set BACKLIGHT_CONTROL combination
firefox
exit 0
I put the 'firefox' line in there just to test if this script is running at all. ls -l /etc/rc.local yields:
-rwxr-xr-x 1 root root 372 2009-05-24 10:20 /etc/rc.local
Upon booting, the brightness controls are not fixed, and firefox does not load. What's wrong?
TIA,
Richard
I'm using Ubuntu 9.04 on the third partition of my Intel Macbook2,1. I want to run the following command *as root* every time Ubuntu loads:
xrandr --output LVDS --set BACKLIGHT_CONTROL combination
This command fixes the backlight brightness controls for Macbooks. It doesn't work if it's not root. If I type 'sudo' plus the command within a terminal, it works perfectly. But I want it to run automatically.
So I tried this: My /etc/rc.local now reads as follows:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
xrandr --output LVDS --set BACKLIGHT_CONTROL combination
firefox
exit 0
I put the 'firefox' line in there just to test if this script is running at all. ls -l /etc/rc.local yields:
-rwxr-xr-x 1 root root 372 2009-05-24 10:20 /etc/rc.local
Upon booting, the brightness controls are not fixed, and firefox does not load. What's wrong?
TIA,
Richard