about summary refs log tree commit diff
path: root/profile/.profile.d/50_browser.sh
blob: 0a15ba15b05e2727e2098f6e97a4b89aac9c6c7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

_browsers="
qutebrowser
chromium
chromium-browser
firefox
lynx
w3m
elinks
links
"

for _browser in ${_browsers}; do
	# shellcheck disable=SC2139
	if command -v "${_browser}" >/dev/null 2>&1; then
		export BROWSER="${_browser}"

		alias b="${BROWSER}"
		if ! command -v br >/dev/null 2>&1; then
			alias br="${BROWSER}"
		fi

		break
	fi
done

unset _browser _browsers

Consider giving Nix/NixOS a try! <3