Skip to content

Instantly share code, notes, and snippets.

@frostidaho
Created January 27, 2017 02:02
Show Gist options
  • Save frostidaho/c4df10b36f41293799ccae8e898b0e52 to your computer and use it in GitHub Desktop.
Save frostidaho/c4df10b36f41293799ccae8e898b0e52 to your computer and use it in GitHub Desktop.
randr xcffib usage stub
# 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