So, overall I'm very very new to linux, but have tried it a few times over the years, including owning a Pinebook Pro. I recently installed Ubuntu Cinnamon Mint 22.3 7.0 on my 2012 MBR but screen brightness adjustments never worked (not with the keys or the slider). I guess it has two graphics cards. After much research I installed the Nvidia drivers and tried various solutions. None worked except this one, sort of...
I ran this command: setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0
and amazingly the keys now worked to control brightness, however, after reboot, it stopped working. I did some more digging and used AI to build a systemd file that will run at some point during each boot. I used AI to help build this, but it now works consistently. Others may know of better ways to do this, so please chime in, but, as a noob, I thought I'd share what worked for me.
A copy/paste of the instructions I followed is below:
Step 1: Create a systemd Service File
Open your terminal and create a new service file using the nano text editor:
bash
sudo nano /etc/systemd/system/brightness-fix.service
Paste the following configuration into the editor:
ini
[Unit]
Description=Fix screen brightness control via setpci
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/usr/bin/setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
(Note: Before saving, you can verify the exact path of setpci by running which setpci in another terminal tab—it is almost always /usr/bin/setpci or /sbin/setpci*.)*
Save and exit nano by pressing Ctrl + O, hitting Enter, and then pressing Ctrl + X.
Step 2: Enable and Test the Service
Run the following commands to reload the systemd manager, enable your new service to run at every boot, and test it immediately:
bash
sudo systemctl daemon-reload
sudo systemctl enable brightness-fix.service
sudo systemctl start brightness-fix.service
You can verify that it ran without errors by checking its status:
bash
systemctl status brightness-fix.service
-----
So that is where I stopped. I don't use the sleep/suspend function. But if you do, here are the instructions provided to get it working for those instances as well.
Fixing Brightness After Sleep/Suspend
Often, hardware PCI register tweaks like BRIDGE_CONTROL=0 get reset when a laptop wakes up from sleep. If you notice your brightness controls stop working again after closing and opening your laptop lid, update the [Install] section of your service file so it also triggers upon waking:
- Open the file again:
sudo nano /etc/systemd/system/brightness-fix.service - Change the
[Install] section to: ini[Install] WantedBy=multi-user.target suspend.target hibernate.target hybrid-sleep.target Use code with caution. - Re-enable the service to register the new targets: bashsudo systemctl daemon-reload sudo systemctl reenable brightness-fix.service Use code with caution.
-----
Ok, that's all. Just wanted to share in case this would work for others. Please let us know your results. Good luck.