aboutsummaryrefslogtreecommitdiffstats
path: root/browser-launcher
diff options
context:
space:
mode:
Diffstat (limited to 'browser-launcher')
-rwxr-xr-xbrowser-launcher36
1 files changed, 36 insertions, 0 deletions
diff --git a/browser-launcher b/browser-launcher
new file mode 100755
index 0000000..0213cbb
--- /dev/null
+++ b/browser-launcher
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+POSITIONAL_ARGS=()
+
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ --*)
+ POSITIONAL_ARGS+=("$1")
+ shift
+ ;;
+ -*)
+ POSITIONAL_ARGS+=("-$1")
+ shift
+ ;;
+ *)
+ POSITIONAL_ARGS+=("$1")
+ shift
+ ;;
+ esac
+done
+
+POSITIONAL_ARGS+=(
+ "--marionette"
+ "--preferences"
+)
+set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
+
+if which firefox >/dev/null 2>/dev/null; then
+ exec firefox "$@"
+elif which librewolf >/dev/null 2>/dev/null; then
+ # not first pick due to it dying somehow randomly
+ exec librewolf "$@"
+else
+ echo "No Supported Browser!" 1>&2;
+ exit 1
+fi