2

I'm trying to get current screen brightness in my Linux kernel module. However, I don't know how can I access the brightness variable, though easily get it in an user-space application using the sysfs interface.

Please let me know a clue about this problem.

Thank you.

Brian
  • 1,663
  • 5
  • 18
  • 26

3 Answers3

2

Usually modern Desktops (GNOME/XFCE4/KDE) provide utilities to change the brightness but answering your question you should look on your /sys/class directory for it. HINT: look for backlight you will find one driver which provides you that functionality.

In my case it is samsung-laptop module and intel.

lmedinas
  • 314
  • 2
  • 13
1

For me

/sys/class/backlight/intel_backlight
$ cat actual_brightness 

This worked to get the actual brightness.You might want to go to /sys/class/backlight and try to ls to see whats in store.

Savannah Madison
  • 575
  • 3
  • 8
  • 17
0

You can change directory to /sys/class/backlight/acpi_video0 and then open actual_brightness file.

cd /sys/class/backlight/acpi_video0
cat actual_brightness
Mr Kashyap
  • 562
  • 1
  • 5
  • 16
XsOuLp
  • 15
  • 4