Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* See LICENSE file for copyright and license details. */
- #include <stdio.h>
- #include <stdlib.h>
- #include <err.h>
- #include <xcb/xcb.h>
- #include <string.h>
- #include "util.h"
- static xcb_connection_t *conn;
- static void usage(char *);
- static void set_name(char *,char *);
- static void
- usage (char *name)
- {
- fprintf(stderr, "usage: %s <name> <wid>\n", name);
- exit(1);
- }
- static void
- set_name(char *name,char *wid)
- {
- xcb_window_t w = strtoul(wid++,NULL,16);
- xcb_change_property(conn,XCB_PROP_MODE_REPLACE,w,XCB_ATOM_WM_NAME,XCB_ATOM_STRING,8,strlen(name),name);
- }
- int
- main(int argc, char **argv)
- {
- if(argc < 3)
- usage(argv[0]);
- init_xcb(&conn);
- set_name(argv[1],argv[2]);
- xcb_flush(conn);
- kill_xcb(&conn);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement