From ea514e9a85778e9f006e4545d1844951e8741ca5 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 6 Apr 2024 09:55:50 +0700 Subject: [PATCH] bar: catch async errors --- .config/ags/config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.config/ags/config.js b/.config/ags/config.js index ed12d0d65..6e2856faa 100644 --- a/.config/ags/config.js +++ b/.config/ags/config.js @@ -27,6 +27,10 @@ function forMonitors(widget) { const n = Gdk.Display.get_default()?.get_n_monitors() || 1; return range(n, 0).map(widget).flat(1); } +function forMonitorsAsync(widget) { + const n = Gdk.Display.get_default()?.get_n_monitors() || 1; + return range(n, 0).forEach((n) => widget().catch(print)) +} // SCSS compilation Utils.exec(`bash -c 'echo "" > ${App.configDir}/scss/_musicwal.scss'`); // reset music styles @@ -74,6 +78,6 @@ App.config({ }); // Stuff that don't need to be toggled. And they're async so ugh... -forMonitors(Bar); +forMonitorsAsync(Bar); // Bar().catch(print); // Use this to debug the bar. Single monitor only.