Conditionally setting a scale factor for X server based on resolution

55 Views Asked by At

I'm working on extending a script which automatically sets up laptops with fresh Ubuntu installation for second use by an NGO. The script is meant for execution from the recovery mode (in console mode) and it creates the users, installs required software etc.

There is a problem with laptops with high resolution, namely all screen elements are very small.

I'd like to extend the script (written in Python and Bash) with the following logic:

  1. Check if screen the resolution is higher than NxM
  2. If yes, update X server config to scale the screen by 0.75x0.75 (or other hardcoded factor).

So my question is two-fold:

  1. How to detect the resolution/DPI from console mode? (xrandr --query doesn't work without X server)
  2. What config file should I update with the scaling factor?
0

There are 0 best solutions below