Score:0

rc.local and xrandr are not working together

bd flag

So I have troubles with the brightness of my screen at startup.

And it's unlucky because I tried many things to set it to right setup and only xrandr is working for me when I call this command.

xrandr --output eDP --brightness 1

On my Ubuntu I had no /etc/rc.local file - so I've created it and made it executable.

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

Content of the file is

#!/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

when I reboot the system I get failed status on rc-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.

What I do wrong?

Edit 1: When I put this into startup it doesn't work too. Startup config

pasman pasmański avatar
mx flag
Which release of Ubuntu you have installed ?
nobody avatar
gh flag
this can not work in my opnion. Please put your command in your autostart. so it starts with your desktop session. This error `greenery rc.local[924]: Can't open display`
TheTanadu avatar
bd flag
@pasmanpasmański 20.04.3 LTS
TheTanadu avatar
bd flag
@nobody about that... weird but it doesn't work too when I put it there, but command itself works if I run it in terminal
nobody avatar
gh flag
for command take `sh -c "xrandr --output eDP --brightness 1"` when you put it in your session autostart.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.