I used to edit the startup script for the GDM (/etc/gdm/Init/Default) to permanently change my display resolution.
How can I do this with LigthDM in Ubuntu Oneiric?
I used to edit the startup script for the GDM (/etc/gdm/Init/Default) to permanently change my display resolution.
How can I do this with LigthDM in Ubuntu Oneiric?
Modify
/etc/lightdm/lightdm.conf
to add the following options:display-setup-script > calls your
mycustomloginvideo.sh
before the login screen appears session-setup-script > calls yourmycustomdesktopvideo.sh
before the user desktop session startsYou 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:
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. If you are setting an external monitor, these scripts will fail when you disconnect it, and X session will not start.
I think you can add the display modes to
/etc/X11/xorg.conf
.If you don't have a
xorg.conf
, then you can use the following as a basis. You need to replace the entries with the namesModeline
,Driver
andModes
with the correct entries for your system. Depending on your hardware, you may need additional entries, for example if your system has more than one graphic chip.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
cvt
:Some one posted another workaround, although I must say It didn't work for me. It could probably work for you. In my case it breaks unity and I can only move my mouse cursor around. 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
/usr/sbin/lightdm-session
Here is how the first part of that file looks now:
Take note that the Xrandr settings should be changed to match yours.
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:
/etc/X11/xorg.conf.d/10-monitor.conf
Then add the appropriate X details for your display here is how mine looked:
The important bits to add are under the appropriate
Section "Monitor"
include the appropriateModeline
that you found while usinggtf 1440 900 60.00
and then under the correspondingSection "Screen"
including the correctModes
.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.
Good Luck!
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:
lighdmxrandr
then I call it in
/etc/lightdm/lightdm.conf
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
-
in the xrandr command--
(didn't show up too clearly on my screen).Create a new document and name it e.g.
/home/yourusername/yourscriptname.sh
Type inand save it in your home folder (this sets the resolution to 1600x900)
Open Startup Applications (or run
gnome-session-properties
) and click "ADD". Give a name and type in the command line:Save it, and now the script will be ran now every you login, so you will need to logout first for it to take effect. Running the command (e.g.
bash /home/yourusername/yourscriptname.sh
) in a terminal would also be a good idea to check whether the script works.Based on responses upper, I have done some test and found a useful method that works to me, then I have created a simple script to automatize it with my automatic installs. But it will work to any other cases.
Create a
scriptinstallxrandrfixed.sh
. Add these lines:it will create the scripts and the files for lightdm display and session. Don't forgot to give it permission to execute
And execute
(you must be placed in same directory where you have the file.)
if not in same directory:
/path/to/script/scriptinstallxrandrfixed.sh
Modify it to feet your needs.