3

After an annoying error with my resolution, I finally managed to change it back to normal. But every time I restart my laptop, it changes it back to the 'old' wrong one. So I have to run the same commands in terminal again to change it back to the correct one.

Someone in another post came with the idea to put the commands in the startup applications, but I can't seem to find the Startup Applications. I am running Lubuntu (Ubuntu 12.04), and I am not so known with it yet. Does anyone have an idea how to change the resolution permanently?

Graphics Card:

xavier@Xavier:~$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 09)

RAM:

xavier@Xavier:~$ grep MemTotal /proc/meminfo
MemTotal:        4063044 kB

CPU Speed:

xavier@Xavier:~$ lscpu | grep "MHz"
CPU MHz:               1000.000
2
  • Can you edit your question please and let us know what operating system you are using.
    – Simon
    Aug 8, 2013 at 12:13
  • Just did so, I am running Ubuntu 12.04 with Lubuntu as desktop
    – user154572
    Aug 8, 2013 at 12:19

5 Answers 5

3

Try creating an xorg.conf file...

sudo gedit /etc/X11/xorg.conf

On newer versions of Ubuntu, it is not recommended to run GUI applications using sudo. Instead use

sudo touch /etc/X11/xorg.conf
gedit admin:/etc/X11/xorg.conf

Then edit the xorg.conf file for your preferred resolution, save, exit, and restart.

You can obtain the correct Modeline for your xorg.conf file by executing the cvt command. In the example below, the command used was

cvt 1280 1024 60.09

where the sequence of parameters are

  • the desired horizontal resolution
  • the desired vertical resolution
  • the monitor's frequency

Reference this answer to see how to use and test the cvt command prior to adding the Modeline to your xorg.conf file. You can also get more information at Resolution.

Here is an example xorg.conf file.

Section "Monitor"
    Identifier  "Samsung SyncMaster 171N"
    Modeline    "1280x1024_60.09"  109.25  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
    Option      "PreferredMode" "1280x1024_60.09"
EndSection

Section "Device"
    Identifier  "Intel"
    Driver      "intel"
EndSection

Section "Screen"
    Identifier "Default Screen"
    Monitor     "Samsung SyncMaster 171N"
    Device      "Intel"
    Defaultdepth 24
    SubSection  "Display"
        Modes   "1280x1024_60.09"
    EndSubSection
EndSection

Section "ServerLayout"
    Identifier  "Default Layout"
    Screen      "Default Screen"
EndSection
2
  • My xorg.conf file looks completely different. I THINK I unintentionally changed some of these settings while fixing the resolution. Where can I see how mine has to look like kind of?
    – user154572
    Aug 8, 2013 at 16:17
  • 1
    Please, add command cvt 1280 1024 60. Thank you! :) Oct 4, 2020 at 6:13
1

I don't know how you set your desired resolution. But if you do that with arandr/xrandr you could save the settings in ~/.xprofile. The settings will be applied after login. More information on the Ubuntu wiki.

1

Well, I'm thinking that you're using the lxde desktop (Lubuntu) but maybe you're using Unity or Metacity or Compiz (Ubuntu). If you're using lxde, you can add startup items in the following fashion in 14.04 (might work in 12.04 but I've never used it, sorry): Open the menu (the super [windows] key opens it in Ubuntu), click on Preferences > Default Applications for LXSession then click on Autostart. You can add startup items by typing in their path into the input field and pressing Add.

If you didn't do this already, then you will probably need to:

  1. Open Terminal: Ctrl+Alt+T

  2. Type in:

    cvt A B C
    

    (Where A=the pixel width of your screen, B=the pixel height, and C=the refresh rate (usually 60 and also optional))

  3. Then type in:

    xrandr --newmode D
    

    (Where D=everything that appears after Modeline)

  4. Then type in:

    xrandr --addmode VGA1 A_B_C
    
  5. Finally:

    xrandr --output VGA1 --mode A_B_C
    

Your screen's resolution should be fixed. Now open a text editor (gedit or leafpad) and put in the following lines:

cvt A B C
xrandr --newmode D
xrandr --addmode VGA1 A_B_C
xrandr --output VGA1 --mode A_B_C

Save it as resolution.sh wherever you feel like (/home/username/.config/autostart might be a nice location) and mark it as executable. Then put its path into the autostart field of the Default Applications for LXSession and click Add. Unfortunately, this only works for individual accounts and does not do anything for the login screen (I'm trying to find a solution for that right now...)

1
  • PJSingh's method will permanently change your resolution, even before the login screen and for all users. Just make sure you edit the "Modeline", "Option", and "Modes" lines in the xorg.conf file you make to suit your monitor (use the cvt command I mentioned above to see your desired settings).
    – SamDuBlake
    Dec 27, 2014 at 15:18
0

The startup application can be found by pressing the Super or Windows key on your keyboard, and typing in Startup Applications then selecting the Startup Applications from the displayed icons.

5
  • When I press this, nothing happens.. Not even the menu bar shows up, but I can also not search like in Ubuntu Unity with the Dash. There is, for as far as I know, no such thing in Lubuntu. At least, I haven't find it.
    – user154572
    Aug 8, 2013 at 12:19
  • 1
    gnome-session-properties is the command for that program, you may be able to manually download it.
    – Simon
    Aug 8, 2013 at 12:28
  • Thanks, this solved half of my problem already! I managed to get the executable file in the startup applications, only there is something really wrong with the resolution now.. It is finally full screen again, the taskbar is also properly but the colors are verry vague for some reason.. Do you maybe have an idea about this?
    – user154572
    Aug 8, 2013 at 13:21
  • To help you with that, we need to know the graphics card, RAM and CPU speed. If you can add these to your original question, I'll do a search for you and see if I can find anything relevant.
    – Simon
    Aug 8, 2013 at 13:39
  • That would be great! I just put the info in my original question @SimplySimon
    – user154572
    Aug 8, 2013 at 18:14
0

The only method that worked for me, was:

  1. Run the necessary commands to get the new mode through cvt and xrandr, explained here: https://wiki.ubuntu.com/X/Config/Resolution#Adding_undetected_resolutions
  2. Paste them in a .sh file, like set_resolution.sh, as an example it would look like this:

    #!/bin/sh
    xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
    xrandr --addmode HDMI-1 1920x1080_60.00
    xrandr --output HDMI-1 --mode 1920x1080_60.00
    
  3. Go to Menu -> Preferences -> Default Applications for LXSession -> Core Applications, and there, scroll down to Xrandr white block, it should be empty and add the path of the .sh file where you saved it.

  4. Reboot!

I'm Using LXDE9.0 with Openbox on an Asus's TinkerBoard. Tried modifying the ~/.xprofile, autostart in /etc/xdg/lxsession, autostart of Openbox, xinitrc, and none of them worked for me. this is only for a session like said before, but it would do the trick faster than going on xorg.conf file that was the last option that I didn't try.

You must log in to answer this question.