First I wrote a small script in /usr/local/bin to set the brightness to the lowest possible value (the lowest value is plenty bright for my eyes):
Then I made the script executable. Next I wrote the following upstart script:
(My default runlevel (as indicated by running the runlevel command) is 2)
At the next boot, my screen's brightness is automatically set to the provided 0 value.
If I wanted to start the 'my-brightness' upstart service anytime, I would simply use the following command:
$ cat /usr/local/bin/set-screen-brightness.sh
#!/bin/bash
echo $1 > /sys/class/backlight/acpi_video0/brightness
Then I made the script executable. Next I wrote the following upstart script:
$ cat /etc/init/my-brightness.conf
description "Set laptop screen to lowest brightness level"
start on runlevel [2]
script
exec /usr/local/bin/set-screen-brightness.sh 0
end script
(My default runlevel (as indicated by running the runlevel command) is 2)
At the next boot, my screen's brightness is automatically set to the provided 0 value.
If I wanted to start the 'my-brightness' upstart service anytime, I would simply use the following command:
$ sudo service my-brightness start
No comments:
Post a Comment