1

I just installed Ubuntu 18.04 LTS in dual boot with Windows 10 on my Thinkpad X1 Yoga 2nd gen which has a high dpi screen (2560x1440). Since the GUI settings do not permit fractional scaling (and 100% is too small while 200% is too big) I followed the intructions in this page.

However, running the following command from terminal

xrandr --output eDP-1 --scale 1.3x1.3 --panning 2560x1440

I get a pretty bad result where the desktop is resized and I get black borders. Moreover I can drag windows in the balck borders but they leave a trace beheind (picture here).

I think it may be a conflict between xrandr and the Gnome desktop enviromment, but it's just a guess. Any suggestions on how to solve this bug?

3

I had this issue too. Something that worked for me is to run the two parts of the command separately:

xrandr --output eDP-1 --scale 1.25x1.25
xrandr --output eDP-1 --panning 2560x1440

I then don't get the black borders. This didn't work in a start-up script, however -- I have to run this every time I log in.

After I suspend and resume, however, the black borders show up again. If anyone has any tips for getting around that, that'd be appreciated.

2

This answers both the OP's question and the other answer's bonus question.

Create a script using:

sudo -H gedit /lib/systemd/system-sleep/scale

Copy these lines into gedit:

#!/bin/bash

# NAME: scale
# PATH: /lib/systemd/system-sleep
# DESC: Reset Ethernet card after suspend, not working automatically
# DATE: Dec 8, 2018


MYNAME=$0

set_scale() {
   xrandr --output eDP-1 --scale 1.3x1.3
   xrandr --output eDP-1 --panning 2560x1440
}

/usr/bin/logger $MYNAME 'case=[' ${1}' ]'
case "${1}/${2}" in
   hibernate|suspend|pre*)
      ;;
   resume|thaw|post*)
      # sleep 2;
      set_scale;;
esac

Save the script and exit gedit.

Mark the script executable using:

chmod a+x /lib/systemd/system-sleep/scale

The script will run every time you resume from suspend.

You can also have it run in your startup applications by adding an entry containing the command:

/lib/systemd/system-sleep/scale post suspend

Startup Applications are run after you sign on.

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.