xworkspace-console/scripts/start-chromium-minimal.sh
Haitao Pan 9ecacca0f7 feat: add xface-minimal config for Stage 2 display stack
- Add xface-minimal config with hidden panel, icons, notifications
- Add start-chromium-minimal.sh for kiosk mode Chrome shell
- Add switch-desktop-mode.sh to toggle xfce/minimal modes
- Update xworkspace-desktop.yaml with minimal and display_stages config
- Implement Display Stack Strategy Stage 2: minimal window manager + Chrome Shell only
2026-06-10 11:45:21 +08:00

57 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
CONFIG_FILE="${ROOT_DIR}/config/xworkspace-desktop.yaml"
read_yaml() {
python3 - "$CONFIG_FILE" "$1" <<'PY'
import sys
from pathlib import Path
import yaml
config_path = Path(sys.argv[1])
path = sys.argv[2].split(".")
data = yaml.safe_load(config_path.read_text())
value = data
for part in path:
value = value[part]
print(value)
PY
}
DASHBOARD_URL="$(read_yaml desktop.dashboard_url)"
BROWSER_BINARY="$(read_yaml desktop.browser_binary)"
BROWSER_FALLBACK="$(read_yaml desktop.browser_fallback)"
URL="${1:-${DASHBOARD_URL}}"
echo "Starting XWorkspace Chrome Shell (minimal mode)..."
echo "URL: ${URL}"
if command -v "${BROWSER_BINARY}" >/dev/null 2>&1; then
exec "${BROWSER_BINARY}" \
--app="${URL}" \
--user-data-dir="${HOME}/.config/xworkspace-chrome-minimal" \
--profile-directory=Default \
--no-first-run \
--disable-session-crashed-bubble \
--disable-sync \
--disable-infobars \
--disable-features=TranslateUI \
--new-window \
--kiosk \
--start-maximized \
--autoplay-policy=no-user-gesture-required
fi
exec "${BROWSER_FALLBACK}" \
--app="${URL}" \
--user-data-dir="${HOME}/.config/xworkspace-chromium-minimal" \
--no-first-run \
--disable-session-crashed-bubble \
--disable-sync \
--disable-infobars \
--new-window \
--kiosk \
--start-maximized \
--autoplay-policy=no-user-gesture-required