update readme

This commit is contained in:
cheykrym 2026-09-15 16:57:04 +03:00
parent 44930fe28c
commit 422eeeffc2
3 changed files with 67 additions and 5 deletions

View File

@ -8,6 +8,15 @@ SOURCE_DIR="$PROJECT_DIR/dist/car_ui"
INSTALL_DIR="/opt/car_ui" INSTALL_DIR="/opt/car_ui"
SERVICE="car-ui.service" SERVICE="car-ui.service"
DESKTOP_USER="cheykrym"
DESKTOP_DIR="/home/$DESKTOP_USER/Desktop"
LAUNCHER_SOURCE="$PROJECT_DIR/system_configs/Return_to_Car_UI.desktop"
LAUNCHER_TARGET="$DESKTOP_DIR/Return_to_Car_UI.desktop"
HELPER_SOURCE="$PROJECT_DIR/scripts/return-to-car-mode.sh"
HELPER_TARGET="/usr/local/bin/return-to-car-mode"
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then
echo "ERROR: deploy.sh must be run as root." echo "ERROR: deploy.sh must be run as root."
echo echo
@ -24,6 +33,18 @@ if [[ ! -x "$SOURCE_DIR/car_ui" ]]; then
exit 1 exit 1
fi fi
if [[ ! -f "$LAUNCHER_SOURCE" ]]; then
echo "ERROR: Desktop launcher not found:"
echo " $LAUNCHER_SOURCE"
exit 1
fi
if [[ ! -f "$HELPER_SOURCE" ]]; then
echo "ERROR: Return-to-Car helper not found:"
echo " $HELPER_SOURCE"
exit 1
fi
echo "==> Stopping $SERVICE" echo "==> Stopping $SERVICE"
systemctl stop "$SERVICE" 2>/dev/null || true systemctl stop "$SERVICE" 2>/dev/null || true
@ -34,10 +55,31 @@ rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR" mkdir -p "$INSTALL_DIR"
cp -a "$SOURCE_DIR/." "$INSTALL_DIR/" cp -a "$SOURCE_DIR/." "$INSTALL_DIR/"
echo "==> Installing Return to Car UI helper"
install -m 755 "$HELPER_SOURCE" "$HELPER_TARGET"
echo "==> Installing desktop launcher"
mkdir -p "$DESKTOP_DIR"
install \
-o "$DESKTOP_USER" \
-g "$DESKTOP_USER" \
-m 755 \
"$LAUNCHER_SOURCE" \
"$LAUNCHER_TARGET"
# Mark launcher as trusted for the desktop environment.
sudo -u "$DESKTOP_USER" \
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u "$DESKTOP_USER")/bus" \
gio set "$LAUNCHER_TARGET" metadata::trusted true 2>/dev/null || true
echo "==> Starting $SERVICE" echo "==> Starting $SERVICE"
systemctl start "$SERVICE" systemctl start "$SERVICE"
echo echo
echo "==> Deployment complete" echo "==> Deployment complete"
echo " $INSTALL_DIR/car_ui" echo " Application: $INSTALL_DIR/car_ui"
echo " Launcher: $LAUNCHER_TARGET"

View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
CAR_UI_BIN="/opt/car_ui/car_ui"
if [[ ! -x "$CAR_UI_BIN" ]]; then
echo "ERROR: Car UI binary not found:"
echo " $CAR_UI_BIN"
exit 1
fi
systemctl disable --now getty@tty1.service
systemctl mask getty@tty1.service
systemctl enable bt-unblock.service
systemctl enable car-ui.service
systemctl set-default multi-user.target
reboot

View File

@ -1,9 +1,9 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name=Return to Car UI Name=Return to Car UI
Comment=Back to Automotive Interface Comment=Reboot into Car mode
Exec=/opt/car_ui/car_ui Exec=pkexec /usr/local/bin/return-to-car-mode
Icon=applications-system Icon=system-reboot
Terminal=false Terminal=false
Categories=Utility; Categories=System;
StartupNotify=false StartupNotify=false