I used to edit the startup script for the GDM (/etc/gdm/Init/Default) for to change permanently my display resolution . But how can I do this with the LigthDM in Ubuntu Oneiric? Thanks.
I think you can add the display modes to
If you don't have a
If you don't know the name of the video driver that your system is using then you may get the name as follows (if you have an intel graphic chip, the driver name is just "intel"):
The modelines can be generated with
display-setup-script > calls your mycustomloginvideo.sh before the login screen appears
session-setup-script > calls your mycustomdesktopvideo.sh before the user desktop session starts
You may have "arandr" gui tool generate the above sh script, picking parameters from your current session's X configuration.
Make sure that your shell script is executable:
chmod a+x /usr/share/mycustom*video.sh
and you can test that it works (i.e. that you don't have any typos or configuration errors in your xrandr command) just by running it in a terminal:
If the login script doesn't work for any reason, your machine might not complete the boot process to the login screen. If the desktop script fails, you might not get a desktop after logging in.
I've created this script to make it more dynamically (multiple workspaces / different monitors).
Only annoyance: when you log in from lightdm, the screen still flashes like it wants to change resolution :s
I have been trying to solve a similar problem for a while now and found a solution that works for me so hopefully it will help...
I have an old aspire one AOA110 that I have broken the screen on too many times and after buying a new laptop decided that I would try to turn it into a HTPC but the external display I have is not recognised by X so I have had to 'tweak' it numerous times to get it working at the correct resolution.
Here is what I did:
After using this http://ubuntuforums.org/showthread.php?t=1112186 tutorial up to step 5 I was able to find a working and acceptable resolution in xrandr but this wasn't working on the LightDM login screen.
Don't follow the steps to make it persistent in the above how to it may work but I think this is the proper way to do it in 11.10. I found this post on the ArchWiki https://wiki.archlinux.org/index.php/Xorg which I adapted to my needs.
First create a file here:
Then add the appropriate X details for your display here is how mine looked:
The important bits to add are under the appropriate
You'll notice that what I was trying to do was not only to set the VGA1 connection to a suitable resolution but also tell it not to use my LVDS1 output. Obviously you will need to tweak yours appropriately to match the right number of outputs and the right Device, Screen and Display sections for your setup.
Sorry for the epic post, I have been tweaking xorg.conf files for some time now with the Hannspree display I've been using and the old xorg.conf setups that I used pre 11.10 just don't work properly any more this is the only solution I've found that works.
Some one posted another workaround although I must say It didn't work for me probably could work for you, in my case it breaks down unity, can only move my mouse cursor around and the app indicator top panel looks empty, but after unplugging my LCD I was able to delete the added lines and everything went back to normal.
edit the file
Here is how the first part of that file looks now:
Take note that the Xrandr settings should be changed to match yours.
I've had a similar problem with my laptop as above, and I wanted to add something to the conversation. If you don't care about the login resolution (I don't), but want the actual workspace to be the right resolution, you can add your monitor information to LightDM but not turn on full resolution until you login.
I just added the following script for my monitor in a file:
then I call it in
Once I login I can setup my monitor in Displays and it works, even after I re-log (used to give me a big ugly error).
As an enhancement for Jon Roberts answer, let me specify that arandr does not include in its sh script generation all parameters working in the current session. Primary monitor (in case you are using a dual monitor configuration), refresh rate and gamma settings for each monitor are not included, for example. My session script looks like that:
I manually added --rate and --primary options in the first line and then added manually a second line with the gamma correction because apparently xrandr gamma settings are lost whenever you switch a monitor to primary.
I do not know if this particular behavior with the gamma settings when making a monitor primary is intended or is a bug.
Moreover the session shell script is not called by lightdm but as a startup application, because it seems that lightdm calls the script before things are ready for xrandr and weird things happen.
I had the problem of wanting an extended display on my new LXDE box, (not a dual clone), found the correct command, but couldn't make it permanent.
The above methods all seemed too hard/not the right way to do it.
I eventually found this: http://www.sudo-juice.com/change-lxde-screen-resolution-ubuntu-lubuntu/
That worked a treat, but I used gedit instead:
Then added the line at the end with an @ symbol at the start:
Hope that helps and thank you to sudo-juice.
PS Note the double
Thank you Jon Roberts for that 'display-setup-script' tip!
I used that to solve a completely different problem. Tap-to-click was still enabled when lightDM ran, and disabled after I logged into Unity. The problem with that, was that it stayed enabled in other DEs (i.e. Xmonad). I wrote a short shell script with 'synclient MaxTapTime=0' and put it under display-setup-script in lightdm.conf and Voila! No more tap-to-click.
Thank you so much!
Create a new document and name it eg:- "yourname.sh" Type in
xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync xrandr --addmode VGA1 1600x900_60.00 xrandr --output VGA1 --mode 1600x900_60.00 unity --replace and save it in your home folder (this is for resolution 1600x900)
open startup applications and click "ADD". Give a name and type in the command line
bash /home/yourname/yourname.sh click save. The change appears after you log out and log in