I have MacBookAir 3,2 (2010) that works surprisingly well with Ubuntu 21.04 (GNOME), when its NVidia driver is correctly enabled.
The problem comes when controlling the screen brightness. The default hotkeys work, xbacklight and nvidia-settings -a BacklightBrightness=## both work, but the brightness setting set through any of these means does not persist between reboots or shutdowns.
From a few similar questions on here I believe it might not be possible, in my case, to make the setting persistent, as no solution attempted has made a difference so far. I am open to suggestions I might not have tried yet but, I thought of a workaround: use what I know works as soon as possible.
I would like to know a means to run either xbacklight and nvidia-settings as soon as they can possibly run with a graphical session available. The closest I have gotten to this is with a .desktop file in either autostart folder, but it is not what I want. I want the brightness setting to be set as soon as the main graphical session (not on login but before or right on the login screen) would allow xbacklight or nvidia-settings to work.
All of this, in short, is 2 questions:
- is there any way to make the screen brightness persist after reboot or shutdown with this configuration?
- if there isn't, when and how, as soon as possible, could I run a script to set the brightness?