Ver código fonte

update scripts

tuanchris 3 meses atrás
pai
commit
31fa168764

+ 25 - 4
dune-weaver-touch/install.sh

@@ -74,10 +74,29 @@ setup_systemd() {
     echo "   🚀 Systemd service installed and enabled"
     echo "   🚀 Systemd service installed and enabled"
 }
 }
 
 
+# Function to setup screen rotation
+setup_screen_rotation() {
+    echo "🔄 Setting up 180° screen rotation..."
+
+    # Add display rotation to boot config if not already present
+    if ! grep -q "display_lcd_rotate=2" /boot/config.txt 2>/dev/null; then
+        if [ -f /boot/config.txt ]; then
+            echo "display_lcd_rotate=2" >> /boot/config.txt
+            echo "   ✅ Display rotation (180°) added to /boot/config.txt"
+        else
+            echo "   ⚠️  /boot/config.txt not found - rotation not configured"
+        fi
+    else
+        echo "   ℹ️  Display rotation already configured"
+    fi
+
+    echo "   🔄 Screen rotation configured"
+}
+
 # Function to setup kiosk optimizations
 # Function to setup kiosk optimizations
 setup_kiosk_optimizations() {
 setup_kiosk_optimizations() {
     echo "🖥️  Setting up kiosk optimizations..."
     echo "🖥️  Setting up kiosk optimizations..."
-    
+
     # Disable boot messages for cleaner boot
     # Disable boot messages for cleaner boot
     if ! grep -q "quiet splash" /boot/cmdline.txt 2>/dev/null; then
     if ! grep -q "quiet splash" /boot/cmdline.txt 2>/dev/null; then
         if [ -f /boot/cmdline.txt ]; then
         if [ -f /boot/cmdline.txt ]; then
@@ -88,7 +107,7 @@ setup_kiosk_optimizations() {
     else
     else
         echo "   ℹ️  Boot splash already enabled"
         echo "   ℹ️  Boot splash already enabled"
     fi
     fi
-    
+
     # Disable rainbow splash
     # Disable rainbow splash
     if ! grep -q "disable_splash=1" /boot/config.txt 2>/dev/null; then
     if ! grep -q "disable_splash=1" /boot/config.txt 2>/dev/null; then
         if [ -f /boot/config.txt ]; then
         if [ -f /boot/config.txt ]; then
@@ -98,10 +117,10 @@ setup_kiosk_optimizations() {
     else
     else
         echo "   ℹ️  Rainbow splash already disabled"
         echo "   ℹ️  Rainbow splash already disabled"
     fi
     fi
-    
+
     # Note about auto-login - let user configure manually
     # Note about auto-login - let user configure manually
     echo "   ℹ️  Auto-login configuration skipped (manual setup recommended)"
     echo "   ℹ️  Auto-login configuration skipped (manual setup recommended)"
-    
+
     echo "   🖥️  Kiosk optimizations applied"
     echo "   🖥️  Kiosk optimizations applied"
 }
 }
 
 
@@ -181,6 +200,7 @@ setup_python_environment
 setup_patterns_permissions
 setup_patterns_permissions
 install_scripts
 install_scripts
 setup_systemd
 setup_systemd
+setup_screen_rotation
 setup_kiosk_optimizations
 setup_kiosk_optimizations
 
 
 echo ""
 echo ""
@@ -191,6 +211,7 @@ echo "✅ Python virtual environment created at: $SCRIPT_DIR/venv"
 echo "✅ Patterns cache directory permissions configured"
 echo "✅ Patterns cache directory permissions configured"
 echo "✅ System scripts installed in /usr/local/bin/"
 echo "✅ System scripts installed in /usr/local/bin/"
 echo "✅ Systemd service configured for auto-start"
 echo "✅ Systemd service configured for auto-start"
+echo "✅ Screen rotation (180°) configured"
 echo "✅ Kiosk optimizations applied"
 echo "✅ Kiosk optimizations applied"
 echo ""
 echo ""
 echo "🔧 Service Management:"
 echo "🔧 Service Management:"

+ 3 - 0
dune-weaver-touch/run.sh

@@ -56,4 +56,7 @@ export QT_QPA_PLATFORM=linuxfb
 export QT_QPA_FB_DRM=1
 export QT_QPA_FB_DRM=1
 export QT_QPA_FONTDIR=/usr/share/fonts
 export QT_QPA_FONTDIR=/usr/share/fonts
 
 
+# Configure touch screen rotation (180 degrees)
+export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0:rotate=180
+
 exec ./venv/bin/python main.py
 exec ./venv/bin/python main.py

+ 1 - 1
dune-weaver-touch/setup_kiosk.sh

@@ -21,7 +21,7 @@ USER_NAME=$(whoami)
 HOME_DIR="/home/$USER_NAME"
 HOME_DIR="/home/$USER_NAME"
 APP_DIR="$SCRIPT_DIR"
 APP_DIR="$SCRIPT_DIR"
 SERVICE_NAME="dune-weaver-kiosk"
 SERVICE_NAME="dune-weaver-kiosk"
-VENV_PATH="$APP_DIR/bin/activate"
+VENV_PATH="$APP_DIR/venv/bin/activate"
 
 
 # Display banner
 # Display banner
 echo -e "${GREEN}"
 echo -e "${GREEN}"

+ 9 - 0
dune-weaver-touch/start-with-fb-check.sh

@@ -44,4 +44,13 @@ sleep 2
 
 
 echo "🚀 Starting Dune Weaver Touch..."
 echo "🚀 Starting Dune Weaver Touch..."
 cd "$SCRIPT_DIR"
 cd "$SCRIPT_DIR"
+
+# Configure Qt platform environment variables
+export QT_QPA_PLATFORM=linuxfb
+export QT_QPA_FB_DRM=1
+export QT_QPA_FONTDIR=/usr/share/fonts
+
+# Configure touch screen rotation (180 degrees)
+export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event0:rotate=180
+
 exec ./venv/bin/python main.py
 exec ./venv/bin/python main.py