#!/bin/sh
# SalesDesk for computers — own Chrome profile, no other websites.
set -e
URL="https://salesdesk.co.ke/desktop/"
DATA="${XDG_DATA_HOME:-$HOME/.local/share}/salesdesk-desktop"
mkdir -p "$DATA"
CHROME=""
for c in google-chrome-stable google-chrome chromium chromium-browser microsoft-edge; do
  if command -v "$c" >/dev/null 2>&1; then CHROME="$c"; break; fi
done
if [ -z "$CHROME" ]; then
  echo "Install Google Chrome or Chromium to run SalesDesk Desktop." >&2
  exit 1
fi
exec "$CHROME" --app="$URL" --user-data-dir="$DATA" --class=SalesDesk \
  --no-first-run --no-default-browser-check "$@"
