Permalink
Browse files

[wikeyname] Prompt the user for a key if isatty(1).

  • Loading branch information...
1 parent 7d98fff commit d73108d5a3d2496c08c9e5831df0b583ba760ecb Kris Maglione committed Jun 16, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 cmd/x11/wikeyname.c
View
@@ -5,6 +5,7 @@
#include <stuff/x.h>
#include <fmt.h>
#include <locale.h>
+#include <unistd.h>
static const char version[] = "wikeyname-"VERSION", "COPYRIGHT"\n";
@@ -38,8 +39,10 @@ main(int argc, char *argv[]) {
if(!grabkeyboard(&scr.root))
fatal("can't grab keyboard\n");
+ if(isatty(1))
+ lprint(2, "Please press a key...\n");
event_loop();
- print("%s\n", keyname);
+ lprint(1, "%s\n", keyname);
XCloseDisplay(display);
return 0;

0 comments on commit d73108d

Please sign in to comment.