Possible to change screen brightness with C?
I'd start with selecting from the following list of ubuntu pacakges, the tool that allows you to manage your screen's brightness (hint: it depends on the brand)
nvidia-settings - Tool of configuring the NVIDIA graphics driver
smartdimmer - Change LCD brightness on Geforce cards
armada-backlight - adjust backlight of Compaq Armada laptops (E300, M500, M700)
ddccontrol - a program to control monitor parameters
eeepc-acpi-scripts - Scripts to support suspend and hotkeys on the Asus Eee PC laptop
fnfxd - ACPI and hotkey daemon for Toshiba laptops
gddccontrol - a program to control monitor parameters
spicctrl - Sony Vaio controller program to set LCD backlight brightness
tpb - program to use the IBM ThinkPad(tm) special keys
xfce4-power-manager - power manager for Xfce desktop
xfce4-power-manager-plugins - power manager plugins for Xfce panel
xvattr - Utility to change Xv attributes
Once you have selected it,
sudo apt-get build-dep <pkgname>
apt-get source --compile <pkgname>
should get you on the right track
How to control backlight by terminal command
There are many possibilities. Just to name a few:
1.Bare echo
echo 8 > /sys/class/backlight/intel_backlight/brightness
For this to work, the user must be in the video
group.
Look at /sys/class/backlight/intel_backlight/max_brightness
to see what maximum brightness is supported.
2.The simplest to use
Install xbacklight
package and then try
xbacklight -inc 20 # increase backlight by 20%
xbacklight -dec 30 # decrease by 30%
xbacklight -set 80 # set to 80% of max value
xbacklight -get # get the current level
3.Over sophisticated
Run xrandr --verbose
and look for a line with resolution like LVDS1 connected 1024x600+0+0
. The name of your display (LVDS1 in this example) is needed here. Now you are ready to set brightness
xrandr --output LVDS1 --brightness 0.4
But this sets only software, not hardware brightness so you can exceed the limits (in both directons). Don't expect beautiful results but if you are brave enough to experiment a little bit then fasten your seatbelt and run
xrandr --output LVDS1 --brightness 1.7
xrandr --output LVDS1 --brightness -0.4 #yes, negative value is possible
xrandr --output LVDS1 --brightness 1
You can torture more your display with xrandr, but be ready to reboot your computer if something goes wrong. For example play with the following
xrandr --output LVDS1 --reflect x
xrandr --output LVDS1 --reflect xy
xrandr --output LVDS1 --reflect normal # return to normal state
xrandr --output LVDS1 --rotate left
xrandr --output LVDS1 --rotate inverted
xrandr --output LVDS1 --rotate normal # again, back to normal
Changing monitor brightness programatically in Ubuntu 11.10
I'm not sure that it's possible to go lower than what the laptop controls get you, but you can programatically change brightness by echoing a value to /sys/class/backlight/<something>/brightness
. On my netbook the 'something' is acpi_video0
.
$ cat /sys/class/backlight/acpi_video0/brightness
10
$ sudo sh -c 'echo 0 > /sys/class/backlight/acpi_video0/brightness'
$ cat /sys/class/backlight/acpi_video0/brightness
0
Edit: There's also xbacklight, which uses XRandr.
How can i change the screen brightness of my laptop in ubuntu?
sudo gedit /etc/default/grub
And then type your root password and insert these lines:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
GRUB_CMDLINE_LINUX="acpi_osi=Linux"
Save and exit.
sudo update-grub
Restart your laptop and then it should work by the "Fn" + left and right arrows.
Related Topics
Splitting Gzipped Logfiles Without Storing the Ungzipped Splits on Disk
Execute Command Line and Return Command Output
How to Copy Folder with Files to Another Folder in Unix/Linux
How to Remove Specific Rules from Iptables
Makefile with Multiple Targets
Bash: Best Architecture for Reading from Two Input Streams
How to Detect Usb Drive Insertion in Linux
Best Way to Set Environment Variables in Calling Shell
How to Use Stdin Twice from Pipe
Qt Creator: Add Qt Module to Project
Ftdi D2Xx Conflict with Ftdi_Sio on Linux - How to Remove Ftdi_Sio Automatically
How to Disable CPU Cache (L1/L2) on a Linux System
Should %Rsp Be Aligned to 16-Byte Boundary Before Calling a Function in Nasm
How to Redirect Cron Job Output to Stdout
How to Check in Bash Whether a File Was Created More Than X Time Ago
Simple Way to Convert Hh:Mm:Ss (Hours:Minutes:Seconds.Split Seconds) to Seconds