-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add -no-input option to not listen to stdin #37
Comments
This could be a valid patch. It doesn't include the option to turn it off using command line yet, but it is trivial to add if necessary. diff --git a/config.def.h b/config.def.h
index 017258e..1e974cf 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,5 +1,7 @@
// use ipc functionality
static bool ipc = false;
+// nostdin
+static bool nostdin = false;
// initially hide all bars
static bool hidden = false;
// initially draw all bars at the bottom
diff --git a/dwlb.c b/dwlb.c
index 40a79f2..c943ca4 100644
--- a/dwlb.c
+++ b/dwlb.c
@@ -1552,7 +1552,7 @@ event_loop(void)
break;
if (FD_ISSET(sock_fd, &rfds))
read_socket();
- if (!ipc && FD_ISSET(STDIN_FILENO, &rfds))
+ if (!ipc && !nostdin && FD_ISSET(STDIN_FILENO, &rfds))
read_stdin();
Bar *bar;
I can add this feature and send a PR if you want to add this. |
Ok, so the above patch does fix the issue, but now the loop constantly runs, increasing cpu usage like crazy. I don't quite understand yet why calling |
Workaround: Why it works: dwlb's stdin is now sleep's stdout which does not close even when sent to bg. Since |
Hello! Go ahead and make a pull request and I will merge it |
Like I mentioned before, the "fix" makes the mainloop jump to the next iteration immediately, causing 100% usage of the core that is running dwlb. I am not sure how read_stdin slows the loop, but it doesn't make my laptop a stove! |
To run dwlb with -no-ipc in the background fails since dwlb is listening to stdin, which puts the application in a suspend state
Add this option to not listen to stdin. so dwlb can be bg'd
The text was updated successfully, but these errors were encountered: