My computer is a ATI graphics card, and Ubuntu12.04LTS cannot automatically save the brightness: The maximum brightness is displayed after each login/unlock, Which is annoying! After studying for one night, I finally got it done with two scripts! Script: bright #! /Bin/bash # Set the display brightness #1. Run this command to view the maximum brightness of the display & n
My computer is a ATI graphics card, and Ubuntu 12.04 LTS cannot automatically save the brightness: The maximum brightness is displayed after each login/unlock, Which is annoying!
After studying for one night, I finally got it done with two scripts!
Script: bright
- #! /Bin/bash
- # Set the display brightness
- #1. Run this command to view the maximum brightness of a display.
- # $ Cat/sys/class/backlight/acpi_video0/max_brightness
- # Select a proper value and write it to/sys/class/backlight/acpi_video0/brightness to change the brightness.
- #2. Allow the users Group to run "sudo tee" without a password"
- # $ Sudo-S sh-c 'echo "% users ALL = (root) NOPASSWD:/usr/bin/tee">/etc/sudoers. d/bright'
- # $ Sudo chmod 0440/etc/sudoers. d/bright
- #3. Add a user to the users user group
- # $ Sudo adduser your_username users
- Echo 15 | sudo tee/sys/class/backlight/acpi_video0/brightness
Script: bright-monitor
- #! /Bin/bash
- # Automatic execution upon successful login, including returning from lock status
- # Set this script to auto start:
- # Right-click the gear icon in the upper right corner-> start the application...
- # Remember to copy the two scripts bright and bright-monitor to/usr/bin.
- # This allows multiple users to conveniently control the brightness.
- Listener-monitor -- session "type = 'signal ', interface = 'org. gnome. ScreenSaver', member = 'activechanged '" | while read line; do
- Bright
- Done
For specific usage, refer to the notes in the script.
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2