mirror of
https://github.com/mintycube/dwmblocks.git
synced 2024-10-22 12:05:47 +00:00
24 lines
394 B
C
24 lines
394 B
C
|
#include "x11.h"
|
||
|
|
||
|
#include <X11/Xlib.h>
|
||
|
|
||
|
static Display *display;
|
||
|
static Window rootWindow;
|
||
|
|
||
|
int setupX() {
|
||
|
display = XOpenDisplay(NULL);
|
||
|
if (!display) {
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
rootWindow = DefaultRootWindow(display);
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
int closeX() { return XCloseDisplay(display); }
|
||
|
|
||
|
void setXRootName(char *str) {
|
||
|
XStoreName(display, rootWindow, str);
|
||
|
XFlush(display);
|
||
|
}
|