summaryrefslogtreecommitdiffstats
path: root/.local/bin/b-bar
diff options
context:
space:
mode:
authorAmin Bandali <bandali@kelar.org>2024-12-04 11:08:01 -0500
committerAmin Bandali <bandali@kelar.org>2024-12-04 11:08:01 -0500
commit7b8b021044b9412894207127e0ea78ef9951f5d2 (patch)
tree38cda2128a327427c5bf5041d8e9bcf18e00e0e0 /.local/bin/b-bar
parentf5dd64a4d3e9322986b396bbfb9a40ee8a77f38a (diff)
downloadconfigs-7b8b021044b9412894207127e0ea78ef9951f5d2.tar.gz
configs-7b8b021044b9412894207127e0ea78ef9951f5d2.tar.xz
configs-7b8b021044b9412894207127e0ea78ef9951f5d2.zip
Try to make b-bar more robustHEADmain
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.
Diffstat (limited to '')
-rwxr-xr-x.local/bin/b-bar2
1 files changed, 1 insertions, 1 deletions
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