Quickly Switch Screen Resolution in Gnome
During the lockdow I started using my laptop’s screen, rather than the external monitor I have at work. It wasn’t easy at the beginning, but it ended up becoming a habit.
On a 15“ monitor screen estate is precious, but HiDPI resolutions are tiring for the eye. Thus I started switching resolution to accommodate the task at hand: more screen when I develop web applications, lower resolution and bigger fonts when I read e-mail or write.
To switch quickly resolutions in Gnome I have the following setup:
- I run Gnome on X11, so that I can use
xrandr. Wayland does not seem to have something similar.
- I defined a set of aliases to change resolution from the command line (see below)
- I defined a set of “Keyboards Shortcuts” (Gnome > Settings > Keyboard Shortcuts) to change resolution using the keyboard (see below).
If you want to try the same setup, put in your
something like, adapting display name and screen resolutions to your
alias zoom1="xrandr --output eDP-1 --mode 1920x1080" alias zoom2="xrandr --output eDP-1 --mode 2048x1152" alias zoom3="xrandr --output eDP-1 --mode 2560x1440" alias zoom4="xrandr --output eDP-1 --mode 2880x1620" alias zoom5="xrandr --output eDP-1 --mode 3200x1800" alias zoom6="xrandr --output eDP-1 --mode 3840x2160"
If you prefer working with the keyboard, use the “Keyboard Shortcuts” pane of the Gnome Settings.
This is not the only solution, of course: a similar result can be obtained using:
- The Zoom factor and enabling fractional scaling.
- The Scaling Factor, which can be set using Gnome Tweaks or
gsettings, from the command line
- The variable
GDK_SCALE, to scale a single application, like, for instance in the following command:
The ArchWiki, as usual, explains the various options in details, see the HiDPI page.
A final note on customizing screen resolutions to your needs. You
can get the resolutions which best fit your monitor with
or, better, using the “Displays” pane in the Gnome Settings, which has
the advantage of reporting also the screen ratio. The name of the
display can be gotten using
… and, if you are wondering, I am aware that the naming convention is probably the opposite of what it should be.