aboutsummaryrefslogtreecommitdiff
path: root/articles/2026/displaying-MATE-on-a-1366x768-screen.html
blob: da494919d34219bfcb2a8b1ed70519974648f370 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!doctype html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="/style.css" />
    <link rel="icon" type="image/x-icon" href="/favicon.ico" />
    <title>displaying MATE on a 1366x768 screen</title>
  </head>
  <body>
    <header>
      <h1>Bloggings</h1>
      <a href="/index.php">Back</a>
    </header>
    <main>
      <article>
        <h2>displaying MATE on a 1366x768 screen</h2>
        <h3>2026-06-15</h3>
        <h4>xrandr to the rescue</h4>
        <p>
          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:
        </p>
        <pre>sudo pkg install xrandr</pre>
        <p>
          type xrandr to get the name of your display, in my case LVDS-1 on my
          Thinkpad X220.
        </p>
        <p>To change 16:9 screen resolution, you can type:</p>
        <pre>
xrandr --output LVDS-1 --panning 1600x900  --scale 1.171x1.172</pre
        >
        <p>or</p>
        <pre>
xrandr --output LVDS-1 --panning 1920x1080 --scale 1.406x1.406</pre
        >
        <p>To get back to the original resolution type:</p>
        <pre>xrandr --output LVDS-1 --panning 1366x768 --scale 1x1</pre>
        <p>
          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.
        </p>
        <pre>
#!/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
        </pre>
        <p>I doubt you can do that in Wayland.</p>
      </article>
    </main>
    <footer>
      <p>§</p>
    </footer>
  </body>
</html>