The undermentioned .sh code should perform what you request:
#!/usr/bin/env -S bash
set -x
Updates package selection
sudo apt update && \
Installs the package
sudo apt install -y 'hwinfo' && \
Invokes the installed package
hwinfo --monitor
An example of its output for me is:
72: None 00.0: 10002 LCD Monitor
[Created at monitor.125]
Unique ID: rdCR.LqF49Z4qR41
Parent ID: svHJ.Zzd7VOLabX6
Hardware Class: monitor
Model: "AOC Q3279WG5B"
Vendor: AOC "AOC"
Device: eisa 0x3279 "Q3279WG5B"
Serial ID: "19441"
Resolution: 720x400@70Hz
Resolution: 640x480@60Hz
Resolution: 640x480@67Hz
Resolution: 640x480@72Hz
Resolution: 640x480@75Hz
Resolution: 800x600@56Hz
Resolution: 800x600@60Hz
Resolution: 800x600@72Hz
Resolution: 800x600@75Hz
Resolution: 832x624@75Hz
Resolution: 1024x768@60Hz
Resolution: 1024x768@70Hz
Resolution: 1024x768@75Hz
Resolution: 1280x1024@75Hz
Resolution: 1920x1080@60Hz
Resolution: 1280x1024@60Hz
Resolution: 2560x1440@60Hz
Size: 725x428 mm
Year of Manufacture: 2018
Week of Manufacture: 25
Detailed Timings #0:
Resolution: 2560x1440
Horizontal: 2560 2568 2600 2666 (+8 +40 +106) -hsync
Vertical: 1440 1443 1448 1481 (+3 +8 +41) +vsync
Frequencies: 296.00 MHz, 111.03 kHz, 74.97 Hz
Year of Manufacture: 2018
Week of Manufacture: 25
Detailed Timings #1:
Resolution: 2560x1440
Horizontal: 2560 2608 2640 2720 (+48 +80 +160) +hsync
Vertical: 1440 1443 1448 1481 (+3 +8 +41) +vsync
Frequencies: 241.50 MHz, 88.79 kHz, 59.95 Hz
Driver Info #0:
Max. Resolution: 2560x1440
Vert. Sync Range: 48-76 Hz
Hor. Sync Range: 114-114 kHz
Bandwidth: 296 MHz
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #1 (VGA compatible controller)
73: None 01.0: 10002 LCD Monitor
[Created at monitor.125]
Unique ID: wkFv.08rGJ7kUoc8
Parent ID: svHJ.Zzd7VOLabX6
Hardware Class: monitor
Model: "AOC Q3279WG5B"
Vendor: AOC "AOC"
Device: eisa 0x3279 "Q3279WG5B"
Serial ID: "40899"
Resolution: 720x400@70Hz
Resolution: 640x480@60Hz
Resolution: 640x480@67Hz
Resolution: 640x480@72Hz
Resolution: 640x480@75Hz
Resolution: 800x600@56Hz
Resolution: 800x600@60Hz
Resolution: 800x600@72Hz
Resolution: 800x600@75Hz
Resolution: 832x624@75Hz
Resolution: 1024x768@60Hz
Resolution: 1024x768@70Hz
Resolution: 1024x768@75Hz
Resolution: 1280x1024@75Hz
Resolution: 1920x1080@60Hz
Resolution: 1280x1024@60Hz
Resolution: 2560x1440@60Hz
Size: 725x428 mm
Year of Manufacture: 2019
Week of Manufacture: 51
Detailed Timings #0:
Resolution: 2560x1440
Horizontal: 2560 2568 2600 2666 (+8 +40 +106) -hsync
Vertical: 1440 1443 1448 1481 (+3 +8 +41) +vsync
Frequencies: 296.00 MHz, 111.03 kHz, 74.97 Hz
Year of Manufacture: 2019
Week of Manufacture: 51
Detailed Timings #1:
Resolution: 2560x1440
Horizontal: 2560 2608 2640 2720 (+48 +80 +160) +hsync
Vertical: 1440 1443 1448 1481 (+3 +8 +41) +vsync
Frequencies: 241.50 MHz, 88.79 kHz, 59.95 Hz
Driver Info #0:
Max. Resolution: 2560x1440
Vert. Sync Range: 48-76 Hz
Hor. Sync Range: 114-114 kHz
Bandwidth: 296 MHz
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #1 (VGA compatible controller)
Luckily, this is independent of the display server (and compositor) so this functions on Wayland too.