With using linux on and off on different PC's through the years, one issue I have not been able to solve is the brightness setting during boot sitting at the Display Manager.

I am running KDE version of ubuntu so I have sddm installed. Googling and searching through the Arch wiki, I am unable to find anything relating to brightness setting when at a Display manager. Once logged on, I set up a script to lower it to the brightness that I like best.

Is there any way to change the brightness when first booting, even an option to hardcode it? From what I see, it is not a setting per display managers.

pc specs

1 Answer 1


I found a solution using a bash script and systemd services for anyone else that may come along and wish there was a screen brightness perseverance.

  1. Make a bash script and place it where you see fit. Here is my example where I named it Brightness_Checker.bash. Also create a text file names something like Brightness_Checker.backup, this will be for storing the brightness value. You will want to update sLoc with that path to the .backup file.


bVal=$(cat $sLoc)

echo $bVal > $bLoc

while :
    cVal=$(cat $bLoc)

    if [ $cVal = "0" ];
        echo 1 > $bLoc

    if [ $bVal != $cVal ];
        echo $bVal > $sLoc
    sleep 10
  1. Within /etc/systemd/system, create a service file similar to mine where ExecStart will point to your bash script:
Description = Brightness checker


  1. From here you want to enable the service:

    sudo systemctl enable Brightness_Checker.service

Then restart your pc.

Note: The reason I have it echo 1 if the brightness is 0 is due to something beyond my pay grade that resets the brightness to full when booting up.

EDIT: One thing I forgot to mention, for security, I would suggest making those 2 files root owner and remove write access from everyone but root otherwise any update to that script could be ran on next startup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .