61 lines
1.7 KiB
Bash
Executable File
61 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Qt Screen Lock Detection Demo - Run Script
|
|
# This script runs the compiled Qt application
|
|
|
|
set -e # Exit on error
|
|
|
|
# Colors for output
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
echo "========================================"
|
|
echo "Qt Screen Lock Detection Demo - Run"
|
|
echo "========================================"
|
|
echo ""
|
|
|
|
# Check if build directory exists
|
|
BUILD_DIR="build"
|
|
if [ ! -d "$BUILD_DIR" ]; then
|
|
echo -e "${RED}Error: Build directory not found!${NC}"
|
|
echo "Please run ./build.sh first to compile the application"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if executable exists
|
|
EXECUTABLE="$BUILD_DIR/bin/ScreenLockDetector"
|
|
if [ ! -f "$EXECUTABLE" ]; then
|
|
echo -e "${RED}Error: Executable not found at $EXECUTABLE${NC}"
|
|
echo "Please run ./build.sh first to compile the application"
|
|
exit 1
|
|
fi
|
|
|
|
echo -e "${GREEN}✓ Executable found${NC}"
|
|
echo ""
|
|
echo "Starting application..."
|
|
echo "----------------------------------------"
|
|
echo ""
|
|
echo "Usage Tips:"
|
|
echo " • The application will monitor screen lock events via DBus"
|
|
echo " • Lock your screen (Ctrl+Alt+L or Super+L) to test"
|
|
echo " • Watch the animation stop when locked"
|
|
echo " • Animation resumes automatically when unlocked"
|
|
echo ""
|
|
echo "----------------------------------------"
|
|
echo ""
|
|
|
|
# Set Qt5 library path and GCC library path
|
|
export QT5_DIR="$HOME/sdk/qt-5.15.2"
|
|
export LD_LIBRARY_PATH="$QT5_DIR/lib:/usr/local/lib64:/usr/local/lib:/home/ubuntu1804/sdk/Vulkan-Loader-1.3.302/lib:$LD_LIBRARY_PATH"
|
|
|
|
# Run the application
|
|
cd "$BUILD_DIR/bin"
|
|
./ScreenLockDetector
|
|
|
|
echo ""
|
|
echo "========================================"
|
|
echo "Application terminated"
|
|
echo "========================================"
|