How to use xrandr to crop broken monitor?

I have a laptop with a broken monitor which is of 1366x768 resolution and I want to use 1144x728 of its right-down corner of its normal part.I used to use lubuntu (sddm and lxde) and porteus (might be sddm? and cinnamon), and I can use following codes to handle it: xrandr --setmonitor bm 1144/344x728/183+222+40 eDP-1. However, it is not working in fedora cinnamon environment.

Here is some infos:

[scbz@bogon ~]$ xrandr
Screen 0: minimum 320 x 200, current 1366 x 768, maximum 16384 x 16384
eDP-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1366x768      60.00*+
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   960x540       59.96    59.99    59.63    59.82  
   800x600       60.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   700x525       59.98  
   800x450       59.95    59.82  
   640x512       60.02  
   700x450       59.96    59.88  
   640x480       60.00    59.94  
   720x405       59.51    58.99  
   684x384       59.88    59.85  
   640x400       59.88    59.98  
   640x360       59.86    59.83    59.84    59.32  
   512x384       60.00  
   512x288       60.00    59.92  
   480x270       59.63    59.82  
   400x300       60.32    56.34  
   432x243       59.92    59.57  
   320x240       60.05  
   360x202       59.51    59.13  
   320x180       59.84    59.32  
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)

[scbz@bogon ~]$ xrandr --setmonitor bm 1144/344x728/183+222+40 eDP-1
output list eDP-1
add monitor eDP-1
output name eDP-1

[scbz@bogon ~]$ xrandr --listmonitors
Monitors: 1
 0: bm 1144/344x728/183+222+40  eDP-1

[scbz@bogon ~]$ inxi -SGCMx
System:
  Host: bogon Kernel: 6.2.9-300.fc38.x86_64 arch: x86_64 bits: 64
    compiler: gcc v: 2.39-9.fc38 Desktop: Cinnamon v: 5.6.8 Distro: Fedora
    release 38 (Thirty Eight)
Machine:
  Type: Laptop System: GOOGLE product: Banon v: 1.0
    serial: <superuser required>
  Mobo: GOOGLE model: Banon v: 1.0 serial: <superuser required>
    UEFI: coreboot v: MrChromebox-4.20.0 date: 05/15/2023
CPU:
  Info: dual core model: Intel Celeron N3060 bits: 64 type: MCP arch: Airmont
    rev: 4 cache: L1: 112 KiB L2: 2 MiB
  Speed (MHz): avg: 1040 high: 1600 min/max: 480/2480 cores: 1: 1600 2: 480
    bogomips: 6400
  Flags: ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx
    Integrated Graphics driver: i915 v: kernel arch: Gen-8 bus-ID: 00:02.0
  Device-2: Realtek HD WebCam type: USB driver: uvcvideo bus-ID: 1-4:2
  Display: x11 server: X.Org v: 1.20.14 driver: X: loaded: modesetting
    unloaded: fbdev,vesa dri: crocus gpu: i915 resolution: 1366x768~60Hz
  API: OpenGL v: 4.6 Mesa 23.0.1 renderer: Mesa Intel HD Graphics 400 (BSW)
    direct-render: Yes

Can anyone please help with? Thanks a lot!

Are you sure you’re using X11 and not Wayland? xrandr doesn’t work in Wayland. The way to tell is, in a terminal type
echo $XDG_SESSION_TYPE

and look at the result. it should say either X11 or Wayland. In Gnome, the default is Wayland, not sure about CInnamon. But in Gnome, after you click your user,name, when you’re on the screen where you enter your password, there’s a little gear icon on the lower right, which enables you to choose Gnome, or Gnome on X11. That may be he problem. There is a wlr-randr package for Wayland, though I don’t know how well it works.
This is all, of course, assuming that it turns out you are using Wayland rather than X11.

Thanks! I believe I have seen it, and it should be Wayland, and thus, that is the point! However, it is midnight here, I will try tomorrow. Thank you very much for the package name wlr-randr! Not sure if cinnamon have X11 version, maybe not as I know. Thanks again!

Here, on Fedora 38 Workstation, xrandr clearly indicates when it is running under wayland:

% echo $XDG_SESSION_TYPE
wayland
% xrandr
Screen 0: minimum 16 x 16, current 2560 x 1440, maximum 32767 x 32767
XWAYLAND0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
   2560x1440     59.91*+
[...]

and

% xrandr --listmonitors
Monitors: 1
 0: +*XWAYLAND0 2560/600x1440/340+0+0  XWAYLAND0

I think wlr-randr is for the wlroots compositor. Here, using Gnome:

% wlr-randr
compositor doesn't support wlr-output-management-unstable-v1

Thanks, I’m not really sure. For my own knowledge, and, I guess that of the OP,if you have time, would you test that xrandr can, indeed change the monitor and/or resolution in Wayland? I feel as if I read somewhere that it didn’t work, though as you show us (and thanks for that) it does work on Wayland. So it may have been that it had limitations, or, that I read it a long time ago and things have changed. Again, only if you have time and inclination.
Thanks.

Unfortunately, it seems I am using x11, where

[scbz@fedora ~]$ echo $XDG_SESSION_TYPE
x11

Is there anything else I could do to reach my point?

I’m sorry, that was the only thing that I knew.

Thank you!
I found it is cinnamon’s problem, since Mint Cinnamon does not work as well.
I have finally found out that due to my hardware, i3wm is more suitable for me and I have used it for about 3 days, feeling very good.

Whatever, thank you very much again! At least I learnt many things about xrandr and x11 things!

1 Like

Thanks for sharing your solution, glad you got it working for yourself. (It also reinforces my opinion that I’m better off with fluxbox, openbox, or dwm than a DE.

A bit more detail could be helpful if someone else has this problem. The only time I needed to to use xrandr to shrink a screen was years ago for some DOS Hercules graphics application that was ported to unix but only supported a fixed screen size.

Do you just arrange windows to avoid the bad section of your screen? Does wlr-randr work with i3?