diff --git a/.gitignore b/.gitignore index ff49935..91db1c7 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ build/ # PyInstaller / packaging *.spec appdir/ +*.AppDir/ +*.AppImage Bulk_Renamer*.AppImage # IDE diff --git a/HSRename.png b/HSRename.png new file mode 100644 index 0000000..668ed12 Binary files /dev/null and b/HSRename.png differ diff --git a/README.md b/README.md index 83182d0..eea6f5c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Bulk Renamer +# HSRename A **native Linux** GUI for mass renaming files. Inspired by [Bulk Rename Utility](https://www.bulkrenameutility.co.uk/#features) (Windows). Rename hundreds of media files with flexible rules, **preview before applying**, and support for **episode renumbering** without losing episode titles. @@ -25,7 +25,7 @@ A **native Linux** GUI for mass renaming files. Inspired by [Bulk Rename Utility ## Install and run ```bash -cd "/home/jorg/Documents/Cursor Projects/Bulk Renamer" +cd /path/to/HSRename pip install -r requirements.txt python main.py ``` @@ -71,7 +71,7 @@ pip install -r requirements.txt -r requirements-build.txt ./build_appimage.sh ``` -You need [appimagetool](https://github.com/AppImage/AppImageKit/releases) installed to produce the final `.AppImage`; if missing, the script still creates the AppDir and prints the exact command. The output is `BulkRenamer.AppImage` (or `BulkRenamer-dev.AppImage`). +You need [appimagetool](https://github.com/AppImage/AppImageKit/releases) installed to produce the final `.AppImage`; if missing, the script still creates the AppDir and prints the exact command. The output is `HSRename.AppImage`. ## Push to Gitea diff --git a/build_appimage.sh b/build_appimage.sh index 2ae018a..675abba 100755 --- a/build_appimage.sh +++ b/build_appimage.sh @@ -1,11 +1,12 @@ #!/usr/bin/env bash -# Build Bulk Renamer as an AppImage. +# Build HSRename as an AppImage. # Requires: pip install -r requirements.txt -r requirements-build.txt -# Optional: appimagetool from https://github.com/AppImage/AppImageKit/releases (for building the final .AppImage) +# Optional: appimagetool from https://github.com/AppImage/appimagetool/releases (for building the final .AppImage) +# Uses HSRename.png in the project folder as the app icon. set -e cd "$(dirname "$0")" -APP_NAME="BulkRenamer" +APP_NAME="HSRename" APPDIR="${APP_NAME}.AppDir" EXE_NAME="$APP_NAME" @@ -28,23 +29,29 @@ rm -rf "$APPDIR" mkdir -p "$APPDIR/usr/bin" cp -a "dist/$EXE_NAME" "$APPDIR/usr/bin/" -cat > "$APPDIR/AppRun" << 'EOF' +cat > "$APPDIR/AppRun" << EOF #!/bin/sh -SELF=$(readlink -f "$0") -HERE=${SELF%/*} -exec "$HERE/usr/bin/BulkRenamer/BulkRenamer" "$@" +SELF=\$(readlink -f "\$0") +HERE=\${SELF%/*} +exec "\$HERE/usr/bin/$EXE_NAME/$EXE_NAME" "\$@" EOF chmod +x "$APPDIR/AppRun" -cat > "$APPDIR/bulk-renamer.desktop" << 'EOF' +cat > "$APPDIR/hsrename.desktop" << 'EOF' [Desktop Entry] -Name=Bulk Renamer +Name=HSRename Comment=Mass rename files with preview and flexible rules -Exec=BulkRenamer -Icon=bulk-renamer +Exec=HSRename +Icon=HSRename Type=Application Categories=Utility;FileTools; EOF +# Use project icon as app icon and logo +if [[ -f HSRename.png ]]; then + cp HSRename.png "$APPDIR/HSRename.png" +else + echo "Warning: HSRename.png not found; appimagetool may fail or use no icon." +fi echo "=== Building AppImage (requires appimagetool) ===" if command -v appimagetool &>/dev/null; then @@ -55,5 +62,5 @@ else echo "AppDir is ready at $APPDIR/" echo "To create the .AppImage, install appimagetool and run:" echo " appimagetool $APPDIR ${APP_NAME}.AppImage" - echo " # Get it from: https://github.com/AppImage/AppImageKit/releases" + echo " # Get it from: https://github.com/AppImage/appimagetool/releases" fi diff --git a/engine/pipeline.py b/engine/pipeline.py index 0d416aa..f81c1a4 100644 --- a/engine/pipeline.py +++ b/engine/pipeline.py @@ -9,7 +9,7 @@ from typing import List, Optional from .rules import Rule -UNDO_FILENAME = ".bulk-renamer-undo.json" +UNDO_FILENAME = ".hsrename-undo.json" def _split_name(name: str) -> tuple[str, str]: diff --git a/gui/main_window.py b/gui/main_window.py index ec1de1d..9843f3d 100644 --- a/gui/main_window.py +++ b/gui/main_window.py @@ -44,7 +44,7 @@ from .rule_widgets import ( class MainWindow(QMainWindow): def __init__(self): super().__init__() - self.setWindowTitle("Bulk Renamer") + self.setWindowTitle("HSRename") self.resize(1000, 700) self._base_dir = "" self._file_names: list[str] = [] diff --git a/main.py b/main.py index 1546789..b51f422 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -Bulk Renamer - Native Linux GUI for mass renaming files. +HSRename - Native Linux GUI for mass renaming files. Inspired by Bulk Rename Utility (Windows); supports preview and flexible rules. """ import sys @@ -21,7 +21,7 @@ def main(): Qt.HighDpiScaleFactorRoundingPolicy.PassThrough ) app = QApplication(sys.argv) - app.setApplicationName("Bulk Renamer") + app.setApplicationName("HSRename") win = MainWindow() win.show() sys.exit(app.exec())