ede/evoke/ede-shutdown.cpp

33 lines
758 B
C++
Raw Normal View History

2009-02-25 18:12:26 +03:00
/*
* $Id$
*
* ede-shutdown, a command to quit EDE
* Part of Equinox Desktop Environment (EDE).
* Copyright (c) 2009 EDE Authors.
*
* This program is licensed under terms of the
* GNU General Public License version 2 or newer.
* See COPYING for details.
*/
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
int main(int argc, char** argv) {
Display* dpy = XOpenDisplay(0);
if(!dpy) {
2011-11-14 12:48:00 +04:00
puts("Unable to open default display");
2009-02-25 18:12:26 +03:00
return 1;
}
int scr = DefaultScreen(dpy);
2009-02-25 20:18:15 +03:00
Atom ede_quit = XInternAtom(dpy, "_EDE_EVOKE_SHUTDOWN_ALL", False);
2009-02-25 18:12:26 +03:00
int dummy = 1;
XChangeProperty(dpy, RootWindow(dpy, scr),
ede_quit, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&dummy, sizeof(int));
2009-02-25 18:19:00 +03:00
XSync(dpy, False);
2009-02-25 18:12:26 +03:00
return 0;
}