From 9248f3945de7fcb5de9a4252f7baf3723b360d4c Mon Sep 17 00:00:00 2001 From: ubuntu1804 Date: Sat, 8 Nov 2025 12:53:54 +0800 Subject: [PATCH] Rename app from ScreenLockDemo to ScreenLockDetector --- make_deb.sh | 14 +++++++------- package/AppDir/AppRun | 2 +- .../icons/hicolor/256x256/apps/screenlockdemo.png | 0 run.sh | 4 ++-- screenlockdemo.desktop | 11 ----------- ...nlockdemo.desktop => screenlockdetector.desktop | 4 ++-- 6 files changed, 12 insertions(+), 23 deletions(-) delete mode 100644 package/AppDir/usr/share/icons/hicolor/256x256/apps/screenlockdemo.png delete mode 100644 screenlockdemo.desktop rename package/AppDir/usr/share/applications/screenlockdemo.desktop => screenlockdetector.desktop (64%) diff --git a/make_deb.sh b/make_deb.sh index 4466257..8dc24cf 100755 --- a/make_deb.sh +++ b/make_deb.sh @@ -10,8 +10,8 @@ BLUE='\033[0;34m' NC='\033[0m' # No Color # 配置变量 -APP_NAME="ScreenLockDemo" -PACKAGE_NAME="screenlockdemo" +APP_NAME="ScreenLockDetector" +PACKAGE_NAME="ScreenLockDetector" VERSION="1.0.0" ARCH="amd64" QT_DIR="$HOME/sdk/qt-5.15.2" @@ -80,7 +80,7 @@ else fi # 复制 desktop 文件 -cp screenlockdemo.desktop "${APPDIR}/usr/share/applications/" +cp screenlockdetector.desktop "${APPDIR}/usr/share/applications/" echo -e "${GREEN}✓ AppDir 结构创建完成${NC}" @@ -130,7 +130,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" APP_DIR="$(dirname "$SCRIPT_DIR")" export LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64:${APP_DIR}/lib:$LD_LIBRARY_PATH" export QT_PLUGIN_PATH="${APP_DIR}/plugins" -exec "${SCRIPT_DIR}/ScreenLockDemo" "$@" +exec "${SCRIPT_DIR}/ScreenLockDetector" "$@" EOF chmod +x "${DEB_DIR}/opt/${PACKAGE_NAME}/bin/${APP_NAME}.sh" @@ -138,13 +138,13 @@ chmod +x "${DEB_DIR}/opt/${PACKAGE_NAME}/bin/${APP_NAME}.sh" # 创建 /usr/bin 软链接 cat > "${DEB_DIR}/usr/bin/${PACKAGE_NAME}" << 'EOF' #!/bin/bash -exec /opt/screenlockdemo/bin/ScreenLockDemo.sh "$@" +exec /opt/ScreenLockDetector/bin/ScreenLockDetector.sh "$@" EOF chmod +x "${DEB_DIR}/usr/bin/${PACKAGE_NAME}" # 复制 desktop 文件和图标 -sed "s|Exec=.*|Exec=/usr/bin/${PACKAGE_NAME}|g" screenlockdemo.desktop > "${DEB_DIR}/usr/share/applications/${PACKAGE_NAME}.desktop" +sed "s|Exec=.*|Exec=/usr/bin/${PACKAGE_NAME}|g" screenlockdetector.desktop > "${DEB_DIR}/usr/share/applications/${PACKAGE_NAME}.desktop" sed -i "s|Icon=.*|Icon=${PACKAGE_NAME}|g" "${DEB_DIR}/usr/share/applications/${PACKAGE_NAME}.desktop" if [ -f "${APPDIR}/usr/share/icons/hicolor/256x256/apps/${PACKAGE_NAME}.png" ]; then @@ -203,7 +203,7 @@ if [ -x /usr/bin/gtk-update-icon-cache ]; then fi echo "Screen Lock Demo 安装完成!" -echo "可以通过命令 'screenlockdemo' 启动,或在应用程序菜单中找到它。" +echo "可以通过命令 'ScreenLockDetector' 启动,或在应用程序菜单中找到它。" exit 0 EOF diff --git a/package/AppDir/AppRun b/package/AppDir/AppRun index 4c00d4b..31ba55f 120000 --- a/package/AppDir/AppRun +++ b/package/AppDir/AppRun @@ -1 +1 @@ -usr/bin/ScreenLockDemo \ No newline at end of file +usr/bin/ScreenLockDetector \ No newline at end of file diff --git a/package/AppDir/usr/share/icons/hicolor/256x256/apps/screenlockdemo.png b/package/AppDir/usr/share/icons/hicolor/256x256/apps/screenlockdemo.png deleted file mode 100644 index e69de29..0000000 diff --git a/run.sh b/run.sh index 114d878..10c6b76 100755 --- a/run.sh +++ b/run.sh @@ -25,7 +25,7 @@ if [ ! -d "$BUILD_DIR" ]; then fi # Check if executable exists -EXECUTABLE="$BUILD_DIR/bin/ScreenLockDemo" +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" @@ -52,7 +52,7 @@ export LD_LIBRARY_PATH="$QT5_DIR/lib:/usr/local/lib64:/usr/local/lib:$LD_LIBRARY # Run the application cd "$BUILD_DIR/bin" -./ScreenLockDemo +./ScreenLockDetector echo "" echo "========================================" diff --git a/screenlockdemo.desktop b/screenlockdemo.desktop deleted file mode 100644 index 5509499..0000000 --- a/screenlockdemo.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=Screen Lock Demo -Comment=Qt Screen Lock Detection Demo Application -Exec=/opt/screenlockdemo/bin/ScreenLockDemo -Icon=/opt/screenlockdemo/share/icons/screenlockdemo.png -Terminal=false -Categories=Utility;Qt; -Keywords=screen;lock;detection;qt;demo; -StartupNotify=true diff --git a/package/AppDir/usr/share/applications/screenlockdemo.desktop b/screenlockdetector.desktop similarity index 64% rename from package/AppDir/usr/share/applications/screenlockdemo.desktop rename to screenlockdetector.desktop index 5509499..2628de0 100644 --- a/package/AppDir/usr/share/applications/screenlockdemo.desktop +++ b/screenlockdetector.desktop @@ -3,8 +3,8 @@ Version=1.0 Type=Application Name=Screen Lock Demo Comment=Qt Screen Lock Detection Demo Application -Exec=/opt/screenlockdemo/bin/ScreenLockDemo -Icon=/opt/screenlockdemo/share/icons/screenlockdemo.png +Exec=/opt/screenlockdetector/bin/ScreenLockDetector +Icon=/opt/screenlockdetector/share/icons/screenlockdetector.png Terminal=false Categories=Utility;Qt; Keywords=screen;lock;detection;qt;demo;