3 * $Id: xtell.c,v 1.1 1998/11/16 23:00:49 mdw Exp $
5 * Wake up a waiting xwait process
7 * (c) 1998 Straylight/Edgeware
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of the Edgeware X tools collection.
14 * X tools is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * X tools is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with X tools; if not, write to the Free Software Foundation,
26 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /*----- Revision history --------------------------------------------------*
32 * Revision 1.1 1998/11/16 23:00:49 mdw
37 /*----- Header files ------------------------------------------------------*/
46 #include <X11/Xutil.h>
50 /*----- Main code ---------------------------------------------------------*/
52 int main(int argc
, char *argv
[])
57 char *atom
= XWAIT_DIE
;
58 char *msg
= XWAIT_DIE_MSG
;
60 /* --- Parse options --- */
63 int i
= getopt(argc
, argv
, "d:a:m:");
77 fprintf(stderr
, "Usage: xtell [-d DISPLAY] [-a ATOM] [-m MSG]\n");
83 /* --- Connect to the display --- */
85 dpy
= XOpenDisplay(display
);
87 fprintf(stderr
, "xtell: couldn't open display\n");
91 /* --- Find the right atom --- */
93 xwait_die
= XInternAtom(dpy
, atom
, False
);
95 /* --- Set the property value --- */
99 if (!XGetTextProperty(dpy
, DefaultRootWindow(dpy
), &prop
, xwait_die
)) {
100 fprintf(stderr
, "xtell: no xwait listening for `%s'\n", atom
);
103 XStringListToTextProperty(&msg
, 1, &prop
);
104 XSetTextProperty(dpy
, DefaultRootWindow(dpy
), &prop
, xwait_die
);
113 /*----- That's all, folks -------------------------------------------------*/