Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RoundSparrow/60bed4d09f68e8c52db584474963b76e to your computer and use it in GitHub Desktop.
Save RoundSparrow/60bed4d09f68e8c52db584474963b76e to your computer and use it in GitHub Desktop.
Ubuntu 17.04 xrandr Python3 script problem
Python script from:
https://askubuntu.com/questions/665709/how-to-recover-offscreen-window-after-disconnecting-second-monitor/665899
Ubuntu 17.04 with 3 4K screens:
$ python3 stackoverflow_665899_try0.py
Traceback (most recent call last):
File "stackoverflow_665899_try0.py", line 9, in <module>
if "+0+0" in s][0]
IndexError: list index out of range
$ xrandr
Screen 0: minimum 8 x 8, current 7680 x 4320, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 3840x2160+3840+0 (normal left inverted right x axis y axis) 1600mm x 900mm
3840x2160 60.00*+ 59.94 29.97 25.00 23.98
4096x2160 59.94 29.97 25.00 24.00 23.98
1920x1080 60.00 59.94 29.97 23.97 60.00
1360x768 60.02
1280x1024 60.02
1280x720 60.00 59.94
1152x864 60.00
1024x768 60.00
800x600 60.32
720x480 59.94
640x480 59.95 59.94 59.93
DP-0 connected 3840x2160+3840+2160 (normal left inverted right x axis y axis) 708mm x 398mm
3840x2160 60.00*+ 59.94 29.97 25.00 23.98
4096x2160 59.94 29.97 25.00 24.00 23.98
2288x1430 61.00
1920x1080 60.00 59.94 29.97 23.97 60.00
1440x480 60.05
1280x720 59.94
720x480 59.94
640x480 59.93
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 connected 3840x2160+0+2160 (normal left inverted right x axis y axis) 607mm x 345mm
3840x2160 60.00*+ 30.00
2560x1440 59.95
1920x1080 60.00 59.94
1680x1050 59.95
1600x900 60.00
1440x900 59.89
1280x1024 75.02 60.02
1280x800 59.81
1280x720 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
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment