All pastes #736448 Raw Edit

Anonymous

public c v1 · immutable
·published 2007-10-14 15:31 UTC
rendered paste body
#include <stdio.h>#include <X11/Xlib.h>#include <X11/Xlibint.h>#include <X11/Xproto.h>#include <X11/Xatom.h>#include <X11/extensions/Xrandr.h>#include <string.h>#include <stdlib.h>#include <stdarg.h>#include <math.h>int main(void){    int size = -1;    int rotation = 1;    int screen = -1;    char          *display_name = NULL;    Display     *dpy;    Window      root;    XRRScreenConfiguration *sc;    Rotation current_rotation;    dpy = XOpenDisplay (display_name);    screen = DefaultScreen (dpy);    root = RootWindow (dpy, screen);    sc = XRRGetScreenInfo (dpy, root);    if (sc == NULL)        exit (1);    size = XRRConfigCurrentConfiguration (sc, &current_rotation);    XRRSetScreenConfig(dpy, sc, DefaultRootWindow(dpy), (SizeID) size, (Rotation) rotation, CurrentTime);    return 0;}