rc.local und xrandr arbeiten nicht zusammen

rc.local und xrandr arbeiten nicht zusammen

Ich habe also Probleme mit der Helligkeit meines Bildschirms beim Start.

Und es ist Pech, denn ich habe vieles versucht, um die Einstellungen richtig vorzunehmen, und nur xrandr funktioniert bei mir, wenn ich diesen Befehl aufrufe.

xrandr --output eDP --brightness 1

Auf meinem Ubuntu hatte ich keine /etc/rc.localDatei – also habe ich sie erstellt und ausführbar gemacht.

~ » ls -laht /etc | grep rc.local
-rwxr-xr-x   1 root root    342 lis 29 19:26 rc.local

Inhalt der Datei ist

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

xrandr --output eDP --brightness 1

exit 0

wenn ich das System neu starte, erhalte ich den Status „Fehlgeschlagen“ aufrc-local.service

~ » sudo systemctl status rc-local.service
● rc-local.service - /etc/rc.local Compatibility
     Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled)
    Drop-In: /usr/lib/systemd/system/rc-local.service.d
             └─debian.conf
     Active: failed (Result: exit-code) since Mon 2021-11-29 19:27:10 CET; 14min ago
       Docs: man:systemd-rc-local-generator(8)
    Process: 920 ExecStart=/etc/rc.local start (code=exited, status=1/FAILURE)

lis 29 19:27:10 greenery systemd[1]: Starting /etc/rc.local Compatibility...
lis 29 19:27:10 greenery rc.local[924]: Can't open display
lis 29 19:27:10 greenery systemd[1]: rc-local.service: Control process exited, code=exited, status=1/FAILURE
lis 29 19:27:10 greenery systemd[1]: rc-local.service: Failed with result 'exit-code'.
lis 29 19:27:10 greenery systemd[1]: Failed to start /etc/rc.local Compatibility.

Was ich falsch mache?

Bearbeitung 1: Wenn ich dies in den Autostart einfüge, funktioniert es auch nicht. Startkonfiguration

verwandte Informationen