summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2014-10-31 21:28:07 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2014-10-31 21:29:42 +0200
commita3e628f1c9f3e7ddfd447d599611729aefc736bb (patch)
treeb4eaef796dde91f50bdeed6017dec90817d444f8 /client
parent2386d44a999307b9f84ecdf7b56cea80eb824c7e (diff)
downloadbemenu-a3e628f1c9f3e7ddfd447d599611729aefc736bb.tar.gz
bemenu-a3e628f1c9f3e7ddfd447d599611729aefc736bb.tar.bz2
bemenu-a3e628f1c9f3e7ddfd447d599611729aefc736bb.zip
Print disco to stderr instead of stdout.
Diffstat (limited to 'client')
-rw-r--r--client/common/common.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/client/common/common.c b/client/common/common.c
index 3366c2c..d8125cd 100644
--- a/client/common/common.c
+++ b/client/common/common.c
@@ -12,8 +12,8 @@ static void
disco_trap(int sig)
{
(void)sig;
- printf("\e[?25h\n");
- fflush(stdout);
+ fprintf(stderr, "\e[?25h");
+ fflush(stderr);
exit(EXIT_FAILURE);
}
@@ -29,18 +29,18 @@ disco(void)
sigaction(SIGINT, &action, NULL);
uint32_t cc, c = 80;
- printf("\e[?25l");
+ fprintf(stderr, "\e[?25l");
while (1) {
for (uint32_t i = 1; i < c - 1; ++i) {
- printf("\r %*s%s %s %s ", (i > c / 2 ? c - i : i), " ", ((i % 2) ? "<o/" : "\\o>"), ((i % 4) ? "DISCO" : " "), ((i %2) ? "\\o>" : "<o/"));
- for (cc = 0; cc < (i < c / 2 ? c / 2 - i : i - c / 2); ++cc) printf(((i % 2) ? "^" : "'"));
- printf("%s %s \r %s %s", ((i % 2) ? "*" : "•"), ((i % 3) ? "\\o" : "<o"), ((i % 3) ? "o/" : "o>"), ((i % 2) ? "*" : "•"));
- for (cc = 2; cc < (i > c / 2 ? c - i : i); ++cc) printf(((i % 2) ? "^" : "'"));
- fflush(stdout);
+ fprintf(stderr, "\r %*s%s %s %s ", (i > c / 2 ? c - i : i), " ", ((i % 2) ? "<o/" : "\\o>"), ((i % 4) ? "DISCO" : " "), ((i %2) ? "\\o>" : "<o/"));
+ for (cc = 0; cc < (i < c / 2 ? c / 2 - i : i - c / 2); ++cc) fprintf(stderr, ((i % 2) ? "^" : "'"));
+ fprintf(stderr, "%s %s \r %s %s", ((i % 2) ? "*" : "•"), ((i % 3) ? "\\o" : "<o"), ((i % 3) ? "o/" : "o>"), ((i % 2) ? "*" : "•"));
+ for (cc = 2; cc < (i > c / 2 ? c - i : i); ++cc) fprintf(stderr, ((i % 2) ? "^" : "'"));
+ fflush(stderr);
usleep(140 * 1000);
}
}
- printf("\e[?25h");
+ fprintf(stderr, "\e[?25h");
exit(EXIT_SUCCESS);
}