Skip to content

Instantly share code, notes, and snippets.

@jgriffiths
Created February 27, 2016 02:45
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 jgriffiths/181d08c6ca6b0779f7ab to your computer and use it in GitHub Desktop.
Save jgriffiths/181d08c6ca6b0779f7ab to your computer and use it in GitHub Desktop.
hacky program to demonstrate _KDE_NET_WM_COLOR_SCHEME
#include <X11/Xlib.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
int main(int argc, const char* argv[])
{
Display *d = XOpenDisplay(NULL);
Window w = XCreateSimpleWindow(d, RootWindow(d, 0), 1, 1, 500, 500, 0,
BlackPixel (d, 0), BlackPixel(d, 0));
Atom a;
XMapWindow(d, w);
if ((a = XInternAtom(d, argv[1], False)) != None)
XChangeProperty(d, w, a, XA_STRING, 8, PropModeReplace, argv[2], strlen(argv[2]));
XFlush(d);
sleep(30);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment