Skip to content
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

No protocol specified Failed to open display #36

Open
johanthoren opened this issue Sep 9, 2020 · 5 comments
Open

No protocol specified Failed to open display #36

johanthoren opened this issue Sep 9, 2020 · 5 comments

Comments

@johanthoren
Copy link

After updating from 904e407 to b7d1970 dwmblocks intermittently crashes with the following messages:

No protocol specified
Failed to open display

The only patch applied is to blocks.def.h:

--- dwmblocks/blocks.def.h      2020-06-22 12:22:39.663038013 +0200
+++ dwmblocks.new/blocks.def.h  2020-06-22 12:26:27.770563841 +0200
@@ -1,11 +1,21 @@
 //Modify this file to change what commands output to your statusbar, and recompile using the make command.
 static const Block blocks[] = {
-       /*Icon*/        /*Command*/             /*Update Interval*/     /*Update Signal*/
-       {"Mem:", "free -h | awk '/^Mem/ { print $3\"/\"$2 }' | sed s/i//g",     30,             0},
-
-       {"", "date '+%b %d (%a) %I:%M%p'",                                      5,              0},
+  /*Icon*/  /*Command*/                     /*Update Interval*/  /*Update Signal*/
+  {"",    "$HOME/bin/status/vpn.sh",        1,                   0},
+  {"",    "$HOME/bin/status/mail.sh",       10,                  0},
+  {"",    "$HOME/bin/status/wired.sh",      10,                  0},
+  {"",    "$HOME/bin/status/wifi.sh",       10,                  0},
+  {"",    "$HOME/bin/status/cpu_load.sh",   5,                   0},
+  {"",    "$HOME/bin/status/cpu_temp.sh",   5,                   0},
+  {"",    "$HOME/bin/status/used_ram.sh",   5,                   0},
+  {"",    "$HOME/bin/status/free_disk.sh",  10,                  0},
+  {"",    "$HOME/bin/status/bat.sh",        10,                  0},
+  {"",    "$HOME/bin/status/airpods.sh",    5,                   0},
+  {"",    "$HOME/bin/status/pacman.sh",     60,                  0},
+  {"",    "$HOME/bin/status/volume.sh",     1,                   0},
+  {"",    "$HOME/bin/status/clock.sh",      1,                   0},
 };

 //sets delimeter between status commands. NULL character ('\0') means no delimeter.
-static char delim[] = " | ";
+static char delim[] = "|";
 static unsigned int delimLen = 5;
@torrinfail
Copy link
Owner

The error you're getting suggests that dwmblocks can't talk to the X server. Most likely sometimes opening the X display failed for you but before this commit there wasn't proper error handling so it never crashed for you. I was already working on changing it so that it only opens the X display once rather than every time the root window name is changed. I just pushed this change so try it out and see if it helps.

@johanthoren
Copy link
Author

@torrinfail, thanks. I'll give it a go and will report back after running for a while.

@johanthoren
Copy link
Author

johanthoren commented Sep 9, 2020

No crash so far. However, coming back after the screensaver had kicked in, the process is still running but nothing is showing from dwmblocks, instead I see the standard 'dwm-6.2' text.

@torrinfail
Copy link
Owner

Interesting. What screensaver utility do you use?(or do you just mean when X automatically makes the screen go black after a little while?) I tried to reproduce with xscreensaver and it worked no problem.

@johanthoren
Copy link
Author

Sorry, I meant when X automatically makes the screen go black.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants