#!/bin/bash

# 设置错误处理机制
set -e

# 设置日志文件路径
# LOG_FILE="/var/log/startup_script.log"
# UART_LOG_FILE="/var/log/uart_script.log"
# APPWINDOW_LOG_FILE="/var/log/appwindow_script.log"

# 设置路径变量
# ENV_PATH="/home/linaro/myenv/bin/activate"
UART_PORT_PATH="/home/linaro/MenuPython_QT/uart_port_rk3568_1024_600.sh"
APPWINDOW_PATH="/home/linaro/MenuPython_QT/appwindow_rk3568_1024_600.sh"
# CLEAN_LOGS_PATH="/home/linaro/MenuPython_QT/clean_log.sh"


# 运行清理日志脚本
# bash $CLEAN_LOGS_PATH "$LOG_FILE" "$UART_LOG_FILE" "$APPWINDOW_LOG_FILE"

# 打印启动信息
# echo -e "启动python脚本......"

# # 发送通知
# notify-send "脚本运行" "Python脚本运行......"

# 启动第一个终端运行uart_port.sh
# echo "[$(date '+%Y-%m-%d %H:%M:%S')] 启动 uart_port.sh 在后台" >> $LOG_FILE
bash $UART_PORT_PATH &

# 启动第二个终端运行appwindow.sh
# echo "[$(date '+%Y-%m-%d %H:%M:%S')] 启动 appwindow.sh 在前台" >> $LOG_FILE
bash $APPWINDOW_PATH

# 发送完成通知
# notify-send "脚本运行" "python脚本运行成功!"

# 打印完成信息
# echo -e "所有脚本运行成功!!!"

