xrandr for changing the lightdm login screen resolution doesn't work in Ubuntu Server with XFCE
by trafikpolisen from LinuxQuestions.org on (#5JE77)
Hi!
I'm in the process of installing a new home server for storage and for running a few vm's with kvm/qemu. It's running Ubuntu Server. As I'm not skilled enough for CLI only, I've installed XFCE. The server will be accessed via VNC and SSH. I should probably also mention that I'm using a HDMI dummy plug, as it will be running headless and I had problems with graphics with no monitor plugged in. Everything now works fine, except for one detail. With the dummy plug installed, the resolution defaults to 1920x1080, which is basically fine. However, since the computer I mainly will be administrating the server from (with VNC) has a screen with a resolution of 1920x1200 (and I'm a bit picky) and I also want to know that the server someday doesn't defaults to maximum resolution or something like that, I want to set the resolution to 1920x1200. This was no problem when logged in, just change in the display settings. But the problem is the login screen (lightdm). According to most search results, the way to change the resolution on the login screen is to create a script that runs xrandr and then add this script to "display-setup-script=" in lightdm.conf. This does unfortunately not work. But if I run the script after I've logged in, the resolution changes correctly. This approach also changes the login screen resolution correctly in Linux Mint and Xubuntu, but not in my Ubuntu Server + XFCE setup. After lot of troubleshooting, I've figured out the following:
The script actually runs (used the touch command inside the script to create a file if it runs).
xrandr runs and exits without error (tested with --verbose and dumping the output to a file, and by dumping the exit code to another file).
If I call another script followed by an ampersand from the first script and the second script runs xrandr after a one second delay, it actually works. So it feels like lightdm isn't "ready" when the display-setup-script is run. However this approach feels a bit "hacky".
So my questions now are:
1. Why isn't it working with xrandr in a script like it does in Linux Mint or Xubuntu?
2. Why does one have to run xrandr in the first place (this feels more like a workaround than a proper solution)? What dictates the resolution of the login screen? Surely there must be a setting in some config file somewhere for this?
All the best!
I'm in the process of installing a new home server for storage and for running a few vm's with kvm/qemu. It's running Ubuntu Server. As I'm not skilled enough for CLI only, I've installed XFCE. The server will be accessed via VNC and SSH. I should probably also mention that I'm using a HDMI dummy plug, as it will be running headless and I had problems with graphics with no monitor plugged in. Everything now works fine, except for one detail. With the dummy plug installed, the resolution defaults to 1920x1080, which is basically fine. However, since the computer I mainly will be administrating the server from (with VNC) has a screen with a resolution of 1920x1200 (and I'm a bit picky) and I also want to know that the server someday doesn't defaults to maximum resolution or something like that, I want to set the resolution to 1920x1200. This was no problem when logged in, just change in the display settings. But the problem is the login screen (lightdm). According to most search results, the way to change the resolution on the login screen is to create a script that runs xrandr and then add this script to "display-setup-script=" in lightdm.conf. This does unfortunately not work. But if I run the script after I've logged in, the resolution changes correctly. This approach also changes the login screen resolution correctly in Linux Mint and Xubuntu, but not in my Ubuntu Server + XFCE setup. After lot of troubleshooting, I've figured out the following:
The script actually runs (used the touch command inside the script to create a file if it runs).
xrandr runs and exits without error (tested with --verbose and dumping the output to a file, and by dumping the exit code to another file).
If I call another script followed by an ampersand from the first script and the second script runs xrandr after a one second delay, it actually works. So it feels like lightdm isn't "ready" when the display-setup-script is run. However this approach feels a bit "hacky".
So my questions now are:
1. Why isn't it working with xrandr in a script like it does in Linux Mint or Xubuntu?
2. Why does one have to run xrandr in the first place (this feels more like a workaround than a proper solution)? What dictates the resolution of the login screen? Surely there must be a setting in some config file somewhere for this?
All the best!