Bloggings

Back

displaying MATE on a 1366x768 screen

2026-06-15

xrandr to the rescue

Unfortunately several Ghostbsd MATE configuration windows are taller than my Thinkpad X220's 768 pixels. I made both the top and bottom panels autohide, but a better solution is to use xrandr:

sudo pkg install xrandr

type xrandr to get the name of your display, in my case LVDS-1 on my Thinkpad X220.

To change 16:9 screen resolution, you can type:

xrandr --output LVDS-1 --panning 1600x900  --scale 1.171x1.172

or

xrandr --output LVDS-1 --panning 1920x1080 --scale 1.406x1.406

To get back to the original resolution type:

xrandr --output LVDS-1 --panning 1366x768 --scale 1x1

Here's a simple bash script that will rotate the screen resolution on each call. I've added a MATE keyboard shortcut (CTRL+RIGHT) to run this script. It is intended for my 1366x768 screen, so it will need adapting for other screens.

#!/usr/bin/env bash
        
RES="$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/')"
# xdpy results can vary by 1 or two pixels 
# so take the first two characters
RES="${RES:0:2}"
        
case "$RES" in
  "13")
  xrandr --output LVDS-1 --panning 1600x900  --scale 1.171x1.172
  ;;
  "16")
  xrandr --output LVDS-1 --panning 1920x1080 --scale 1.406x1.406
  ;;
  *)
  xrandr --output LVDS-1 --panning 1366x768 --scale 1x1
  ;;
esac
        

I doubt you can do that in Wayland.