So I installed LUbuntu 11.04 on my VirtualBox. I couldn't find the 1366x768 resolution so I installed Guest Additions but it wasn't there. So I used this code to set the correct resolution:

gtf 1366 768 60
xrandr --newmode "1368x768_60.00"  85.86  1368 1440 1584 1800  768 769 772 795 $
xrandr --addmode VBOX0 1368x768_60.00
xrandr --output VBOX0 --mode 1368x768_60.00

The problem is that I can't find a way to save this information for the next reboot. I tried on .xinitrc and nothing happens. Then I tried on .bashrc but it's not working, I need to start a console before this commands are executed.

link|improve this question

You could try putting those commands into your /etc/rc.local. – user42257 Jan 16 at 20:00
I edited the file and I changed the execution bits but it's not happening. Maybe LUbuntu works differently. – dierre Jan 17 at 9:18
feedback

2 Answers

up vote 1 down vote accepted

I was trying to change the default resolution of LXDE on Ubuntu (LXDE is also used in Lubuntu) and I found a solution for this problem. I also have Lubuntu installed and I've checked that this file actually exists which it does (Ijust tried this fix as well and it worked).

So, the fix....

  1. Open up a terminal, press ctrl+alt+t
  2. I'm guessing you have a default Lubuntu install, so "Leafpad" would be your default editor, type/copy this into the terminal and press enter... (you may be asked for a password)

    sudo leafpad /etc/xdg/lxsession/LXDE/autostart
    
  3. Now add your commands to the bottom of the file adding a @ before the actual command. Mine looked like this after...

    @xscreensaver -no-splash
    @lxpanel --profile LXDE
    @pcmanfm --desktop --profile LXDE
    @/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
    @xrandr --auto --output DVI-1 --primary --mode 1680x1050 --left-of DVI-0
    
link|improve this answer
Worked like a charm. – dierre Mar 3 at 9:43
feedback

I personally put those sorts of commands, to be run at login, in a script in ~/bin , call it set_resolution

Then run gnome-session-properties and add the command to be run at login (use ~/bin/set_resolution).

enter image description here

link|improve this answer
It's LUbuntu, non Ubuntu, so I do not have gnome-session-properties – dierre Jan 17 at 9:05
Openbox (Lubuntu) uses ~/.config/openbox/autostart – bodhi.zazen Jan 17 at 15:53
still not working. I've added ~/.config/openbox/autostart then chmod u+x but at reboot nothing is happening. – dierre Jan 17 at 16:46
feedback

Your Answer

 
or
required, but never shown

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