added a Makefile to use it as a C library. no python dependencies. added 2 example...
[rofl0r-libxauto.git] / src / test_sendtext.c
blobdbf25f179f7af8a9890bded9347e057fcbc65b77
1 #include "xaut.h"
2 #include <stdio.h>
4 int main(int argc, char** argv) {
5 if (argc < 3) return 1;
7 char* id_text;
8 char* send_text;
9 if (strcmp(argv[1], "--v") == 0) {
10 if (argc < 4) return 1;
11 extra_verbose(1);
12 id_text = argv[2];
13 send_text = argv[3];
14 } else {
15 id_text = argv[1];
16 send_text = argv[2];
19 Window winid = atoi(id_text);
21 if(activate_window(winid)) {
22 sleep(1);
23 type(send_text);
24 return 0;
26 return 1;