Package org.lwjgl.opengl
Class XRandR
- java.lang.Object
-
- org.lwjgl.opengl.XRandR
-
public class XRandR extends java.lang.Object
Utility for working with the xrandr commmand-line utility. Assumes xrandr v1.2 or higher.- Author:
- ryanm
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XRandR.Screen
Encapsulates the configuration of a monitor.
-
Constructor Summary
Constructors Constructor Description XRandR()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static XRandR.Screen[]
getConfiguration()
static XRandR.Screen[]
getResolutions(java.lang.String name)
static java.lang.String[]
getScreenNames()
static void
restoreConfiguration()
Restores the configuration for all connected display devices.static void
saveConfiguration()
Saves the current configuration for all connected display devices.static void
setConfiguration(boolean disableOthers, XRandR.Screen... screens)
-
-
-
Method Detail
-
getConfiguration
public static XRandR.Screen[] getConfiguration()
- Returns:
- The current screen configuration of the primary device, or an empty array if xrandr is not supported
-
setConfiguration
public static void setConfiguration(boolean disableOthers, XRandR.Screen... screens)
- Parameters:
disableOthers
- if screens not included in screens should be turned off (true) or left alone (false)screens
- The desired screen set, may not benull
- Throws:
java.lang.IllegalArgumentException
- if no screens are specified
-
saveConfiguration
public static void saveConfiguration()
Saves the current configuration for all connected display devices. This configuration can be restored on exit/crash by calling restoreConfiguration()
-
restoreConfiguration
public static void restoreConfiguration()
Restores the configuration for all connected display devices. Used on exit or in case of a crash to reset all devices.
-
getScreenNames
public static java.lang.String[] getScreenNames()
- Returns:
- the name of connected screens, or an empty array if xrandr is not supported
-
getResolutions
public static XRandR.Screen[] getResolutions(java.lang.String name)
- Parameters:
name
-- Returns:
- the possible resolutions of the named screen, or
null
if there is no such screen
-
-