1

So I followed this post but I am stuck because of this output:

ln: failed to create symbolic link '/sys/class/brightness': Operation not permitted.

What I wanted to try is:

$ cd /sys/class This directory should contain a soft link called brightness to the brightness device discovered in the previous step. Should it be missing, create it: $ sudo ln -s /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness /sys/class/brightness

Note that: There is no "brightness" folder inside /sys/class. But there is "backlight" folder. What should I do? Should "brightness" folder/file?

Creating the file, gives me, "Operation not permitted". I used "cat > brightness" command. It didn't work. Now the only option I have is to create a folder.

Meanwhile, I can't control the brightness through the "brightness" button. Even moving the "Brightness bar" manually doesn't respond.

Screenshot of Brightness bar

Brightness button & bar used to work, but dunno what happened. How do I resolve this issue?

Pranav
  • 1,200
  • Try this: sudo su followed by ln -s /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness /sys/class/brightness (that is, if the directory exists. The poster of the answer only used it as an example.) – Jos Apr 23 '19 at 09:04
  • @Jos I tried ur command and it says: "su: user ln does not exist". And I tired it without using "ln", it says "permission denied". What should I do? – Pranav Apr 23 '19 at 10:47
  • They are two commands. First log in as root using sudo su. You type your password and the prompt changes from $ to # to indicate you are now root. Then enter the second command ln -s etc. – Jos Apr 23 '19 at 10:54
  • @Jos It says, "ln: failed to create symbolic link './brightness': Operation not permitted". Do I need to create a file or a folder named "brightness" inside /sys/class/? – Pranav Apr 23 '19 at 11:14
  • You are right. /sys nowadays has its own file system sysfs and it is mounted nosuid, meaning sudo does not have effect there. Your instructions must have been written before that. – Jos Apr 23 '19 at 11:22
  • @Jos Should I create a file or folder? I used "cat brightness" inside /sys/class, it says "permission denied". – Pranav Apr 23 '19 at 11:43

2 Answers2

1

Try this:

sudo -s
mount -o rw,remount,suid -t sysfs sysfs /sys
ln -s /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness /sys/class/brightness

That should fix it.

Actually, you don't even need to do that. All those steps are not required if you want to control brightness. You already have the brightness control, all this command is doing is creating a small link to that.

Do this:

#For finding out current brightness:         
cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness

#To set brightness to a level        
echo 100 > /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness

Change the number to whatever you like. There is an upper limit. This is not usually a percentage. So you should be able to set brightness to 281, for example.

Your last error was using cat command incorrectly. cat command show the content of a file.

  • even using "touch brightness" command inside /sys/class gives me this output: "touch: cannot touch 'brightness': Permission denied" @domo-n-car – Pranav Apr 24 '19 at 06:44
  • "sudo -s" output is "sudo: /bin/CHS: command not found". What should i do? – Pranav Apr 24 '19 at 07:19
0

For some reason, changing this line solved the issue:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"

For that, do this:

$cd /etc/default
$sudo gedit grub

Put above line and restart. This didn't work before but it worked somehow. Try using "video" instead of "vendor" which is very unusual. But it might help.

Pranav
  • 1,200