mirror of
https://github.com/0intro/wmii
synced 2024-11-21 21:31:33 +03:00
[wikeyname] Prompt the user for a key if isatty(1).
This commit is contained in:
parent
d9486fa419
commit
f45311261e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user