Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Created April 22, 2017 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PuercoPop/7cbcd861af1bfc8f5c5dc0a6dfc25fb2 to your computer and use it in GitHub Desktop.
Save PuercoPop/7cbcd861af1bfc8f5c5dc0a6dfc25fb2 to your computer and use it in GitHub Desktop.
;; (ql:quickload :clx)
(destructuring-bind (hostname display-id screen-id protocol)
(xlib::get-default-display ":1")
(let ((display (xlib:open-display hostname :display display-id :protocol protocol)))
(xlib/xinerama:xinerama-is-active display)))
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
// clang -std=c99 -pedantic -Werror -I/usr/include test-xinerama.c -o test-xinerama -lc -lX11 -lXinerama
#include <X11/Xlib.h>
#include <X11/extensions/Xinerama.h>
static Display *dpy;
int
main(int argc, char *argv[])
{
dpy = XOpenDisplay(":1");
if(!dpy) perror("Unable to open display.\n");
bool xineramap;
xineramap = XineramaIsActive(dpy);
printf("Xinemara is active? %d\n", xineramap);
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment