From a58ff03539666a5aba074a197cb344837ef387f8 Mon Sep 17 00:00:00 2001 From: Lucas Zampieri Date: Wed, 13 May 2026 20:46:14 -0300 Subject: [PATCH] KindleHIDPassthrough: install KOReader plugin when KOReader is present The kindle-hid-passthrough release tarball now ships a koreader-plugin/ directory. When /mnt/us/koreader/plugins/ exists, copy koreader-plugin/hidpassthrough.koplugin/ into it so users get the in-KOReader manager (scan / pair / connect / disconnect / logs / cache) without an extra install step. Skipped silently when KOReader isn't installed. uninstall.sh removes the plugin directory to mirror install behavior. Signed-off-by: Lucas Zampieri --- KindleHIDPassthrough/install.sh | 8 ++++++++ KindleHIDPassthrough/uninstall.sh | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/KindleHIDPassthrough/install.sh b/KindleHIDPassthrough/install.sh index 9788cc4..8977b5c 100644 --- a/KindleHIDPassthrough/install.sh +++ b/KindleHIDPassthrough/install.sh @@ -38,6 +38,14 @@ mkdir -p "$INSTALL_DIR/cache" cp "$INSTALL_DIR/illusion/BTManager.sh" /mnt/us/documents/BTManager.sh chmod +x /mnt/us/documents/BTManager.sh +# ---- Install KOReader plugin (if KOReader is installed) ---- + +if [ -d /mnt/us/koreader/plugins/ ] && [ -d "$INSTALL_DIR/koreader-plugin/hidpassthrough.koplugin" ]; then + mkdir -p /mnt/us/koreader/plugins/hidpassthrough.koplugin + cp -r "$INSTALL_DIR/koreader-plugin/hidpassthrough.koplugin/." \ + /mnt/us/koreader/plugins/hidpassthrough.koplugin/ +fi + # ---- Start daemon ---- /sbin/initctl start hid-passthrough || true diff --git a/KindleHIDPassthrough/uninstall.sh b/KindleHIDPassthrough/uninstall.sh index 658b38c..63c43d3 100644 --- a/KindleHIDPassthrough/uninstall.sh +++ b/KindleHIDPassthrough/uninstall.sh @@ -31,6 +31,10 @@ DELETE FROM handlerIds WHERE handlerId='$APP_ID'; EOF fi +# ---- Remove KOReader plugin (if installed) ---- + +rm -rf /mnt/us/koreader/plugins/hidpassthrough.koplugin + # ---- Remove files ---- rm -rf "$INSTALL_DIR"