0

With Ubuntu 18.04, I need the command line xrandr --output DP-1 --scale 0.5x0.5. How can I automate that command when I power on my computer?

EDIT

I created the /etc/rc.local file, and in that file I have written

#!/bin/bash

xrandr --output DP-1 --scale 0.5x0.5

exit 0

The problem is if I restart the computer, the screen is identical and wrong. It seems to work if I run the command bash /etc/rc.local, but not if I restart the computer. How can I fix that?

J.Doe
  • 53
  • 8

1 Answers1

0

xrandr will not work from rc.local because it needs Xorg (graphical mode) running. You need to use a way to autostart commands/applications for your Desktop Environment after you logged in as some user. AFAIU For default Ubuntu 18.04 this method should work.

If you want the changes to affect Display Manager (the thing you see before logging in as a user) too that's more difficult, please add what DM you are using either by edit or comment.

int_ua
  • 8,892