Control monitor settings from command line

Hello,

I would like to be able to control monitor settings from command line. I was hoping this can be done with gsettings but when I run:

$ gsettings monitor org.gnome.Settings
last-panel: 'display'
last-panel: 'sharing'
last-panel: 'display'
last-panel: 'keyboard'
last-panel: 'display'

As I flip settings for the 2 monitors (like disabling one of the two, or changing the refresh rate and/or scaling) nothing is printed.

Does Gnome not expose these via gsettings?

I just want to be able to disable/enable one of the two attached monitors from command-line…

xrandr can set the resolution as far as monitor control i’m uncertain if xrandr has this or not never used it for said purposes

What do you make of this?

$ xrandr --listmonitors
Monitors: 2
 0: +*DP-3 3840/700x2160/390+0+0  DP-3
 1: +Virtual-1 2560/650x1600/400+3840+0  Virtual-1

$ xrandr --output Virtual-1 --off
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  7 (RRSetScreenSize)
  Serial number of failed request:  27
  Current serial number in output stream:  29

I wonder if it doesn’t work due to Wayland?

this would have been good to know. I don’t use wayland so i am unsure how xrandr works with it.

gnome-randr-rust

would be needed to get something similar…

1 Like