2

I just want to make a script to change my screen resolution. I found many guides to do that, but all of them are made for Xorg Display Server users and i could't find one for Wayland. My question is, there is any way to make a script for that using Wayland?
I want to change the main "XWAYLAND1" monitor to 1280x720 and back to 1920x1080. I'm using Ubuntu 22.10
xrandr output:

Screen 0: minimum 16 x 16, current 3360 x 1080, maximum 32767 x 32767
XWAYLAND1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
   1920x1080     59.96*+
   1440x1080     59.99  
   1400x1050     59.98  
   1280x1024     59.89  
   1280x960      59.94  
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1680x1050     59.95  
   1440x900      59.89  
   1280x800      59.81  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   1600x900      59.95  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  
   1280x720_60.00  60.00  
   1920x1080_60.00  60.00  
   1024x768_60.00  60.00  
XWAYLAND2 connected 1440x900+1920+0 (normal left inverted right x axis y axis) 410mm x 260mm
   1440x900      59.75*+
   1152x864      59.78  
   1024x768      59.68  
   800x600       59.47  
   640x480       59.38  
   320x240       59.52  
   1280x800      59.81  
   720x480       59.71  
   640x400       59.20  
   320x200       58.96  
   1368x768      59.71  
   1280x720      59.86  
   1024x576      59.58  
   864x486       59.45  
   720x400       59.55  
   640x350       58.91 

gtf 1280 720 60 output:

# 1280x720 @ 60.00 Hz (GTF) hsync: 44.76 kHz; pclk: 74.48 MHz
  Modeline "1280x720_60.00"  74.48  1280 1336 1472 1664  720 721 724 746  -HSync +Vsync

gtf 1920 1080 60 output:

# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
  Modeline "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync

4
  • 1
    Does this answer your question? Change screen resolution using the terminal (command line) in Wayland - Ubuntu 18.04
    – popey
    Apr 16, 2023 at 15:59
  • 1
    Sadly not, when i run the python file i get an error message:ValueError: could not convert string to float: '60,000' (I replaced the first line with this: #!/usr/bin/env python3 )
    – EndRE32
    Apr 16, 2023 at 19:00
  • @EndRE32 Try removing the quote marks from around the number.
    – ArrayBolt3
    Apr 23, 2023 at 2:03
  • @ArrayBolt3 Hello, there are no quote marks around the number, i tried float(rate[1:-1]) and the output was '9,88' from '59,887'
    – EndRE32
    Apr 24, 2023 at 14:42

0

You must log in to answer this question.

Browse other questions tagged .