I have a laptop with a 3200x1800 screen. When I start up my laptop, lightdm doesn't scale to the resolution and looks tiny. When I lock the screen afterwards, lightdm scales and looks fine. I found this bug report but no solution.

I've found a small fix that seems to work on login, but not on the lock screen. This solution also makes the top bar a little botched as the text is to big for the confinds - perhaps a costum theme would be the best solution? Also it's probably reliant upon the desktop already having set the Xft.dpi value highger.

  1. Open a terminal and run xrdb -query | grep dpi
  2. Open /usr/share/glib-2.0/schemas/com.canonical.unity-greeter.gschema.xml
  3. Find by key-name="xft-dpi" type="d"
  4. Replace the default value with the DPI from the xrdb output

This should go in effect instantly (logging out shows the larger text on my side).

  • 1
    the work around doesn't work on Ubuntu 16.10 – Greg Dan Nov 4 '16 at 17:32
  • Hi @GregDan, you may want to check out my answer below. I found this solution on Ubuntu 16.10, and it's working fine. – Seer Jan 29 '17 at 20:14

The solution appears to be mimicking what Ubuntu's 'Screen Displays' application does to scale the UI when you're logged in. I tracked the two settings required down. I made a script to automatically set this for my user for when I'm logged in (i.e. not unity-greeter), but you can use the same settings to alter unity-greeter.

I have 2 4K displays, and wanted to have them both set with a scaling factor of 2, this is what my script looks like:

#!/usr/bin/env bash

set -e

# Find connected displays, we're assuming that all of the 
# connected displays will require scaling.
function createScaleFactor() {
    SCREENS=$(xrandr --query | grep " connected" | awk '{ print $1 }')
    FACTORS=$(for SCREEN in ${SCREENS}; do printf "'${SCREEN}': 16, "; done)

    echo "{${FACTORS::-2}}"
}

# Set both gnome and ubuntu interface scaling.
gsettings set org.gnome.desktop.interface scaling-factor 2
gsettings set com.ubuntu.user-interface scale-factor "$(createScaleFactor)"

Right at the end there you can see the two settings you need to change. So, to change them for unity-greeter (i.e. lightdm), you need to be logged in as lightdm. You can use dconf-editor to do this:

$ sudo xhost +SI:localuser:lightdm
$ sudo su -s /bin/bash lightdm
$ dconf-editor

Once you see dconf-editor, navigate to the two keys in the above script, and set them to the values you need. If you've run that script above, you can open dconf-editor normally, and just grab the values it generated and set for you and copy them into the dconf-editor instance that's running as lightdm.

Just to put the icing on the cake, this solution also doesn't make anything look weird. The entire thing scales properly, without the text looking abnormally large for the UI or anything like that. Some of the images are not quite as sharp as they could be, but you could customise those if you wanted, and perhaps they'll be updated to higher resolution images in the future.

Ideally, in a future update either there'd be an option to set this, or it would automatically detect it (perhaps in a similar way to how it sets the user wallpaper).

  • This didn't work for me until I changed lightdm's shell: sudo usermod lightdm -s /bin/bash. – chuwy Feb 18 '17 at 14:11
  • Aah yes, I was missing the shell from the su - I've updated the post. You don't need to set it permanently like that though, see the edit. – Seer Feb 19 '17 at 1:16
  • This is half a solution for me, the text scaling worked (text in status bar got smaller), but the display scaling doesn't. – Nur Sep 5 '17 at 16:10
  • This answer worked with Ubuntu 16.04. If it's no longer valid, the method should still work, and you can use dconf's watch mode to figure out which properties to change (enter watch mode then change your logged in scaling factor, dconf should be printing out the values being changed). – Seer Sep 7 '17 at 6:02

The other answers are fine. However they will only scale the fonts. This will cause unevenness between fonts and other elements. You should scale the whole display. For this you need to run a script when lightdm starts and set scaling with xrandr. You can find the details here: http://evren-yurtesen.blogspot.fi/2017/10/lightdm-and-4k-displays.html

  • This will stretch pixels; looks like an old CRT-style scaling method. – Redsandro Nov 29 '17 at 12:21
  • Yes, it actually decreases resolution. However I use this on an htpc and it is perfectly fine when I look at the screen from 5m away. I guess it is one way to go. :) – yurtesen Nov 30 '17 at 0:44

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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