From f45311261e62cae35ec55358cddd12c46cbed7d6 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 16 Jun 2010 18:35:32 -0400 Subject: [PATCH] [wikeyname] Prompt the user for a key if isatty(1). --- cmd/x11/wikeyname.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/x11/wikeyname.c b/cmd/x11/wikeyname.c index 2caa488e..b4188f73 100644 --- a/cmd/x11/wikeyname.c +++ b/cmd/x11/wikeyname.c @@ -5,6 +5,7 @@ #include #include #include +#include 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;