diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-06-18 17:17:43 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-06-18 17:17:43 (GMT) |
commit | f9cad238343b6ae64455c62cea21189974eccfbf (patch) | |
tree | 07e573030a2061cfffe82893e7972f1484e5541c /scripts/list-outputs.c | |
parent | 5cd2139a8a6d9d389dae45f1acc7e2e226af6213 (diff) |
Disable all but one X outputs
Sugar cannot deal properly with multiple outputs.
Diffstat (limited to 'scripts/list-outputs.c')
-rw-r--r-- | scripts/list-outputs.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/list-outputs.c b/scripts/list-outputs.c new file mode 100644 index 0000000..f2c3f0b --- /dev/null +++ b/scripts/list-outputs.c @@ -0,0 +1,31 @@ +#include <stdio.h> +#include <X11/extensions/Xrandr.h> + +int main(int argc, char **argv) +{ + Display *dpy = XOpenDisplay(NULL); + XRRScreenResources *rr; + XRROutputInfo *output; + int i; + + XSynchronize(dpy, 1); + + rr = XRRGetScreenResources(dpy, DefaultRootWindow(dpy)); + + for (i = 0; i < rr->noutput; i++) { + output = XRRGetOutputInfo(dpy, rr, rr->outputs[i]); + + if (output->connection == RR_Connected) { + printf("%s\n", output->name); + } + + XRRFreeOutputInfo(output); + } + + XRRFreeScreenResources(rr); + + XSync(dpy, 1); + XCloseDisplay(dpy); + + return 0; +} |