2

I have a problem regarding setting a custom resolution on my built-in display for my laptop. My desired resolution is 1600x900. It's not shown in the Display Settings in Ubuntu 16.04, but after running the following,

sudo xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync and
sudo xrandr --addmode eDP-1 "1600x900_60.00"

the resolution is added to Displays Settings and I can apply it. Additionally, I put the 2 commands at the end of my ~/.profile file, as this tutorial recommended. The problem is that it does not persist after a restart, rather I get an error: "Could not apply the stored configuration for monitors".

Additionally, I lack the /etc/gdm/init/Default file to place these commands in that script.

  • It looks like the xrandr commands aren't being executed properly. If you're going to add them to your ~/.profile, make sure you get rid of the sudos in front of them. – nixpower Jan 2 '18 at 20:23
  • You are right, i have paste the commands with the 'sudo' in front of them. After removing 'sudo' everything works fine after restart. Thanks And have a nice day! – BR4TO92 Jan 3 '18 at 14:45
5

(Posting this as an answer from the comments)

The lines in ~/.profile should not be prepended with sudo. Thus, the lines to be appended should be as such:

xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync and
xrandr --addmode eDP-1 "1600x900_60.00"
2

Assuming 16.04 still uses lightdm (I think it does) you can set up a script to do your monitor settings.

Modify /etc/lightdm/lightdm.conf to add the following options:

display-setup-script > calls your "xrandr scriptname.sh" before the login screen appears

session-setup-script > calls your "xrandr scriptname.sh" before the user desktop session starts

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
# for your login screen, e.g. LightDM (Ubuntu 11.10) or GDM (11.04 or earlier)
display-setup-script=[your xrandr script goes here]
# for your desktop session (I didn't do this one)
session-setup-script=[your xrandr script goes here]
  • Thanks for your advice. I'm sure it'll work. nixpower found the problem, I have accidentally inserted the 'sudo' command in front of the two 'xrandr' commands, in the ~/.profile file. After removing them everything works. After restart the resolution remains the custom one. Thanks and have a nice day! – BR4TO92 Jan 3 '18 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.