Not a solution but rather a workaround.
There should be a file
In this file you have a particular decimal value which corresponds to brightness.
Now, when I use openbox desktop environment, my fn key doesn't work, which is why i use the following script to set it:
printf " \n Entering file to change brightness in 3 seconds\n remember - no new line after number. ";
sudo nano /sys/class/backlight/acpi_video0/brightness
Now, you may want to check the
/sys/class/backlight folder just to make sure that you have acpi_video0 file there. It may be named differently for your system
I will link a relevant askubuntu question if you're interested in varioius workarounds for setting brightness
I've wrote another script which uses zenity (graphical front end for scripts) and xrandr, with a desktop shortcut.
Tools you need
- xrandr (should be installed by default, don't quote me on that) and knowing the name of your display
- zenity (should be installed by default, don't quote me on that)
- desktop shortcut backlight.desktop
backlight.desktop file on your desktop and make it executable with
sudo chmod a+x ~/Desktop/backlight.desktop. (Note, you may want to make it executable through rightclick -> properties and also allow running text files as executables in Nautilus-> Edit-> Properties-> Behavior).
Note, Icon portion is optional.
Place this file in
/usr/bin folder, call it
# Name: backlightscript
# Author: Serg Kolo
# Date: March 2 , 2015
# Description: Simple script to change screen brightness using xrandr
# uncomment this for debugging as needed
# set -x
NEWVAL=$( zenity --scale --min-value=0 --max-value=7 --text="Enter number between 0 and 7" ) && brightness=$(($NEWVAL+2))
if [ $(echo $?) = 0 ]
xrandr --output LVDS --brightness 0.$brightness
I've found that optimal brightness is between 0.2 and 0.9. If you go bellow 0.2 or 1 screen gets either too dark or too bright. In this script, the user double-clicks on the backlight.desktop shortcut, which calls graphical pop-up with a scale, where user selects necessary brightness from 0 to 7. That value is incremented by 2 ( so max is 7+2=9 and min is 0+2=2 ) and stored in brightness variable. That variable then becomes the value after decimal point for
xrandr --output LVDS --brightness 0.$brightness.
The if - then block is used to test whether the user actually selected something. Without it, xrandr will set brightness to 0, in which case you won't see anything on your screen, even tty1, and will have to either reboot or do Alt+SYSRQ+R+E+I+S+U+B
Note, that xrandr is a software solution, not hardware solution, i.e. you're not changing brightness of screen directly.
How it should look
Note on xrandr
Run xrandr without any arguments to determine your primary connected display
Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
VGA-0 disconnected (normal left inverted right x axis y axis)
LVDS connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 193mm