The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 4,232β€…    Votes:  2β€…
Tags: gnome   18.04   xorg   display-resolution   xrandr  
Link: πŸ” See Original Answer on Ask Ubuntu ⧉ πŸ”—

URL: https://askubuntu.com/q/1099471
Title: High DPi screen xrandr scaling on ubuntu 18.04 LTS
ID: /2018/12/09/High-DPi-screen-xrandr-scaling-on-ubuntu-18.04-LTS
Created: December 9, 2018
Upload: September 15, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


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.

⇧ ASUS PCE cant detect 5ghz network cal -w does not work  β‡©