summarylogtreecommitdiffstats
path: root/microsoft-edge-beta.sh
blob: f621c68ed5a079c1a9063e6032b5bec6888c8683 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env sh
# Launches MS Edge with flags specified in $XDG_CONFIG_HOME/microsoft-edge-beta-flags.conf

# Make script fail if `cat` fails for some reason
set -e

# Set default value if variable is unset/null
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}"

# Attempt to read a config file if it exists
if [ -r "${XDG_CONFIG_HOME}/microsoft-edge-beta-flags.conf" ]; then
  EDGE_USER_FLAGS="$(cat "$XDG_CONFIG_HOME/microsoft-edge-beta-flags.conf")"
fi

exec /opt/microsoft/msedge-beta/microsoft-edge-beta $EDGE_USER_FLAGS "$@"