Artificial intelligent assistant

Change X server configuration at runtime Environment: NVidia video card with NVidia drivers. Debian 8. Multiple monitors I currently have 2 screens connected to my computer. Usually (while working) I like to use both. Sometimes (while gaming) I only want one to be active. Actually there is a third usecase (watching movie on a projector, while screen 1 and 2 are off) but let's ignore that for now. What I am looking for is a simple way (cli command, script that can be tied to e.g a hotkey, etc) to change the X server configuration. I can use nvidia-settings to change the configuration, but that is a clicky interface and I am looking for the one-button solution. Does not matter if the configuration sticks across reboots (preferred would be only temporary change)

The tool you are looking for is 'xrandr'. Running xrandr without parameters gives you the list of known outputs, attached devices, available resolutions (including preferred ones and used ones).

For example, to deactivate an output, run


xrandr --output NAME-OF-OUTPUT --off


To set an output to on and its preferred resolution, run


xrandr --output NAME-OF-OUTPUT --auto


Or to a specific, supported resolution


xrandr --output NAME-OF-OUTPUT --mode 1024x768


There are many more options, just look into the man pages. Collect your xrandr commands in shell scripts and configure your system to execute those scripts upon hotkey press.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 5f33836d6c3deb62252b469cb231d1be