Created
January 27, 2017 02:02
-
-
Save frostidaho/c4df10b36f41293799ccae8e898b0e52 to your computer and use it in GitHub Desktop.
randr xcffib usage stub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/a/21498380 | |
import xcffib | |
import xcffib.xproto | |
import os | |
conn = xcffib.connect(os.environ['DISPLAY']) | |
screen = conn.get_setup().roots[conn.pref_screen] | |
window = conn.generate_id() | |
x = conn.core.CreateWindow( | |
xcffib.CopyFromParent, window, screen.root, | |
0, 0, 0, 0, 0, | |
xcffib.xproto.WindowClass.CopyFromParent, | |
screen.root_visual, 0, None, | |
) | |
import xcffib.randr as RandR | |
randr = conn(RandR.key) | |
x = randr.GetCrtcInfo(443,0) | |
y = x.reply() | |
print(y.__dict__) | |
x = randr.GetOutputInfo(459, 0) | |
y = x.reply() | |
print(y.__dict__) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment