#!/bin/bash
# CorWorkspace Linux client. Opens the desktop in a dedicated browser window.
URL="${CORWORKSPACES_URL:-https://workspaces.corapp.com/}"
if [[ -n ${1:-} ]]; then
  URL="$1"
fi
if command -v google-chrome-stable >/dev/null 2>&1; then
  exec google-chrome-stable --app="$URL" --class=CorWorkspace
fi
if command -v chromium >/dev/null 2>&1; then
  exec chromium --app="$URL" --class=CorWorkspace
fi
if command -v microsoft-edge >/dev/null 2>&1; then
  exec microsoft-edge --app="$URL"
fi
echo "Install Google Chrome, Chromium, or Microsoft Edge, then run corworkspace again." >&2
exit 1
