Script incomplete?

Hi, i try to install this script:

Backlight is always at full brightness after a reboot with amdgpu driver

https://wiki.archlinux.org/index.php/backlight#Backlight_is_always_at_full_brightness_after_a_reboot_with_amdgpu_driver

fix-brightness.sh is placed in my home folder, with the change with my own hardware that i found in folder /var/lib/systemd/backlight:

#! /bin/bash

# Change the line below according to your hardware
BRIGHTNESS_FILE="/var/lib/systemd/backlight/pci-0000:04:00.0:backlight:amdgpu_bl0"
BRIGHTNESS=$(cat "$BRIGHTNESS_FILE")
BRIGHTNESS=$(($BRIGHTNESS*255/65535))
BRIGHTNESS=${BRIGHTNESS/.*} # truncating to int, just in case
echo $BRIGHTNESS > "$BRIGHTNESS_FILE"

Then i place fix-brightness.service in /etc/systemd/system/:

[Unit]
Description=Convert 16-bit brightness values to 8-bit before systemd-backlight applies it
Before=systemd-backlight@backlight:amdgpu_bl0.service

[Service]
Type=oneshot
ExecStart=/home/user/fix-brightness.sh

[Install]
WantedBy=multi-user.target

Then i do this in root terminal:
systemctl start fix-brightness.service
systemctl enable fix-brightness.service

After reboot the brightness is back to 100% :unamused:, then i do this:
systemctl status systemd-backlight@backlight:amdgpu_bl0.service
The service start correct, but now it say “0 is to low for brightness, try to 2”.

Then i going to this file:

/var/lib/systemd/backlight/pci-0000:04:00.0:backlight:amdgpu_bl0

and set manually 0 in 2 (with root), but after reboot its again to 0! How can this be? What im doing wrong?

I found another workaround:

Topic can be closed.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.