How can I adapt Ubuntu to a high resolution display?
I have a display with 3200x1600px on only 11'' and everything looks really tiny.
display-resolutionfontshdpixorg
How can I adapt Ubuntu to a high resolution display?
I have a display with 3200x1600px on only 11'' and everything looks really tiny.
Install my Firefox-addon Zoom Menu Elements (or install this file from source on github).
Alternative: you can manually open a new tab about:config
in Firefox and search for layout.css.devPixelsPerPx
set this value to 2
or 1.5
as you wish to adjust the size of the Firefox icons
(source, bug report)
Install the Firefox-addon Fix for zoomed default-font to fix some issues with huge form elements on some pages (for ex. the login on reddit.com, ... see this question )
Pinch-to-zoom works out of the box (see here), for older versions the grab and drag addon for Firefox makes it possible to navigate the Internet by touch (disable it with the button in the add-on-bar when using a mouse)
Additionally, (but not needed) install the Firefox addon NoSquint or Default Fullzoomlevel and chose in settings: default full page zoom level 120%.
In Thunderbird you have to go for the alternative from step 1 in the advanced configuration (although I prefer not to change the overall size but use Ctrl+ and Ctrl- instead, to adjust the size of the email window)
A major convenience upgrade would be to use a background script, automatically setting the resolution per application, while you can set different resolutions for different (multiple) applications at once.
That is exactly what the script below does.
An example of a default resolution of 1680x1050
:
Running gedit
, automatically changing to 640x480
:
Running gnome-terminal
, automatically changing to 1280x1024
:
When the application is closed, the resolution is automatically set back to 1680x1050
set_resolution.py
In the head of the script, set your default resolution, in the line:
#--- set the default resolution below
default = "1680x1050"
#---
In the very same directory (folder), create a textfile, exactly named: procsdata.txt
. In this textfile, set the desired application or process, followed by a space, followed by the desired resolution. One application or script per line, looking like:
gedit 640x480
gnome-terminal 1280x1024
java 1280x1024
Run the script by the command:
python3 /path/to/set_resolution.py
The script use pgrep -f <process>
, which catches all matches, including scripts. The possible downside is that it can cause name clashes when opening a file with the same name as the process.
If you run into issues like that, change:
matches.append([p, subprocess.check_output(["pgrep", "-f", p]).decode("utf-8")])
into:
matches.append([p, subprocess.check_output(["pgrep", p]).decode("utf-8")])
#!/usr/bin/env python3
import subprocess
import os
import time
#--- set the default resolution below
default = "1680x1050"
#---
# read the datafile
curr_dir = os.path.dirname(os.path.abspath(__file__))
datafile = curr_dir+"/procsdata.txt"
procs_data = [l.split() for l in open(datafile).read().splitlines() if not l == "\n"]
procs = [pdata[0] for pdata in procs_data]
def check_matches():
# function to find possible running (listed) applications
matches = []
for p in procs:
try:
matches.append([p, subprocess.check_output(["pgrep", "-f", p]).decode("utf-8")])
except subprocess.CalledProcessError:
pass
match = matches[-1][0] if len(matches) != 0 else None
return match
matches1 = check_matches()
while True:
time.sleep(2)
matches2 = check_matches()
if matches2 == matches1:
pass
else:
if matches2 != None:
# a listed application started up since two seconds ago
resdata = [("x").join(item[1].split("x")) for item in \
procs_data if item[0] == matches2][0]
elif matches2 == None:
# none of the listed applications is running any more
resdata = default
subprocess.Popen(["xrandr", "-s", resdata])
matches1 = matches2
time.sleep(1)
When the script starts, it reads the file in which you defined your applications and their corresponding desired screen resolutions.
It then keeps an eye on the running processes (running pgrep -f <process>
for each of the applications) and sets the resolution if the application starts up.
When pgrep -f <process>
does not produce output for any of the listed applications, it sets the resolution to "default".
While the version above works with multiple listed applications, it only sets the resolution for one application at a time.
The version below can handle different applications with a different (required) resolution, running at the same time. The background script will keep track of what is the front most application, and will set the resolution accordingly. It also works fine with Alt+Tab.
Note that this behaviour might be annoying if you switch a lot between the desktop and listed applications; the frequent resolution switch might be too much.
The setup is pretty much the same, appart from the fact that this one uses wmctrl
and xdotool
:
sudo apt-get install wmctrl
sudo apt-get install xdotool
#!/usr/bin/env python3
import subprocess
import os
import sys
import time
#--- set default resolution below
resolution = "1680x1050"
#---
curr_dir = os.path.dirname(os.path.abspath(__file__))
datafile = curr_dir+"/procsdata.txt"
applist = [l.split() for l in open(datafile).read().splitlines()]
apps = [item[0] for item in applist]
def get(cmd):
try:
return subprocess.check_output(["/bin/bash", "-c", cmd]).decode("utf-8")
except subprocess.CalledProcessError:
pass
def get_pids():
# returns pids of listed applications; seems ok
runs = []
for item in apps:
pid = get("pgrep -f "+item)
if pid != None:
runs.append((item, pid.strip()))
return runs
def check_frontmost():
# returns data on the frontmost window; seems ok
frontmost = str(hex(int(get("xdotool getwindowfocus").strip())))
frontmost = frontmost[:2]+"0"+frontmost[2:]
try:
wlist = get("wmctrl -lpG").splitlines()
return [l for l in wlist if frontmost in l]
except subprocess.CalledProcessError:
pass
def front_pid():
# returns the frontmost pid, seems ok
return check_frontmost()[0].split()[2]
def matching():
# nakijken
running = get_pids(); frontmost = check_frontmost()
if all([frontmost != None, len(running) != 0]):
matches = [item[0] for item in running if item[1] == frontmost[0].split()[2]]
if len(matches) != 0:
return matches[0]
else:
pass
trigger1 = matching()
while True:
time.sleep(1)
trigger2 = matching()
if trigger2 != trigger1:
if trigger2 == None:
command = "xrandr -s "+resolution
else:
command = "xrandr -s "+[it[1] for it in applist if it[0] == trigger2][0]
subprocess.Popen(["/bin/bash", "-c", command])
print(trigger2, command)
trigger1 = trigger2
Best Answer
There are some steps to take:
1. System wide Menu and titlebar scaling
Starting with Ubuntu 14.04 we have an option that helps a bit:
Scaling Support
open the System Settings (here in english:)
Go to "Displays" and set the "Scale for menu and title bars":
Since Ubuntu 17.10 the scaling can be set in
Go to
Settings > Devices > Displays
theresee also: How to find and change the screen DPI?
2. Universal Access
Go to "Universal Access" (
unity-control-center universal-access
) and select "Large Text".Note: not all applications handle this correctly, some will not reserve the extra space, so some UI elements are not accessible with this option!
3.increase unity dock size
In
unity-control-center
->Appearance
->Look
at the botom, you can adjust the size4. adapt Firefox
see: Adjust Firefox and Thunderbird to a High DPI touchscreen display (retina)
(or use Chrome, which works fine since Version 41.0.2272.76 Ubuntu 14.10, though Chrome will need to be restarted to take effect)
5. increase font in Pidgin
There is a plugin you can install
Then you can increase the font in Plugins->Extended Prefs
6. create starter for applications that still don't scale
Some applications still don't obey the global scaling (mainly java) for those few applications you can create a starter to only Fix scaling of java-based applications for a high DPI screen
in older Ubuntu versions, with unity-tweak-util in the section "Fonts" you can set the "Text Scaling Factor" to 2.0. This will scale the fonts in most applications to double size.