From 7b8b021044b9412894207127e0ea78ef9951f5d2 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Wed, 4 Dec 2024 11:08:01 -0500 Subject: Try to make b-bar more robust On a few rare occasions the bar seemed to "hang" and its information get stale, and I believe this first happened when I started pulling in some data from emacsclient. So wrapping the call to emacsclient in a timeout is an attempt to remedy that, in case emacs(client) blocks for some reason. --- .local/bin/b-bar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/b-bar b/.local/bin/b-bar index 04ae6bb..9e292c5 100755 --- a/.local/bin/b-bar +++ b/.local/bin/b-bar @@ -20,7 +20,7 @@ do adelita|anahita) if [ -x "$(command -v emacsclient)" ]; then embat='(battery-format b/battery-format (funcall battery-status-function))' - bat="$(emacsclient -e "$embat")" + bat="$(timeout 3 emacsclient -e "$embat")" bat="${bat%\"}" bat="${bat#\"}" else -- cgit v1.2.3-60-g2f50