Monday, June 19, 2017

Quick Re-Set for Desktop using xrandr

All too often when installing a game, a problem occurs that halts the game and does not restore my desktop to the proper size.

To look at what I used to have and what I wound up with is simple.

$ xrandr
Screen 0: minimum 8 x 8, current 2560 x 1024, maximum 8192 x 8192
DVI-I-0 disconnected primary (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
DVI-I-2 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 376mm x 301mm
   1280x1024     60.02*+  75.02 
   1280x960      60.00 
   1152x864      75.00 
   1024x768      75.03    70.07    60.00 
   800x600       75.00    72.19    60.32    56.25 
   640x480       75.00    72.81    59.94 
DVI-I-3 connected 1280x1024+1280+0 (normal left inverted right x axis y axis) 376mm x 301mm
   1280x1024     60.02*+  75.02 
   1280x960      60.00 
   1152x864      75.00 
   1024x768      75.03    70.07    60.00 
   800x600       75.00    72.19    60.32    56.25 
   640x480       75.00    72.81    59.94 


So all I had to do was create a small shell script named restore to change the display back to the resolution I normally use, place it in ~/bin and make it executable.


#!/bin/sh
xrandr -s 2560x1024


No comments: