aboutsummaryrefslogtreecommitdiff
path: root/X
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2022-04-27 23:01:55 +1200
committerTom Ryder <tom@sanctum.geek.nz>2022-04-27 23:06:34 +1200
commite72fc71b61f8c7a6d56c13a47b625979a0320e10 (patch)
treed5866d1b8d2c97431a4a1130523abb0017b08249 /X
parentMerge branch 'release/v11.20.0' into develop (diff)
downloaddotfiles-e72fc71b61f8c7a6d56c13a47b625979a0320e10.tar.gz
dotfiles-e72fc71b61f8c7a6d56c13a47b625979a0320e10.zip
Use more elegant stdout/stderr blocking
Diffstat (limited to 'X')
-rw-r--r--X/xsession.d/browser.sh10
1 files changed, 4 insertions, 6 deletions
diff --git a/X/xsession.d/browser.sh b/X/xsession.d/browser.sh
index 024075d6..44afc78e 100644
--- a/X/xsession.d/browser.sh
+++ b/X/xsession.d/browser.sh
@@ -1,16 +1,14 @@
# Choose a GUI browser with some rough heuristics
# If LibreWolf or failing that Firefox is available, start by assuming that
-if command -v librewolf >/dev/null 2>&1 ; then
+if command -v librewolf ; then
BROWSER=librewolf
-elif command -v firefox >/dev/null 2>&1 ; then
+elif command -v firefox ; then
BROWSER=firefox
-fi
+fi >/dev/null 2>&1
# Consider a switch to Dillo...
if (
- # No output, please
- exec >/dev/null 2>&1
# Don't switch if it's not there
command -v dillo || exit 1
# Do switch if neither LibreWolf nor Firefox are there
@@ -19,7 +17,7 @@ if (
awk '$1=="MemTotal:"&&$2<2^20{m++}END{exit!m}' < /proc/meminfo
) ; then
BROWSER=dillo
-fi
+fi >/dev/null 2>&1
# Export our choice of browser, if it isn't empty
[ -n "$BROWSER" ] || return