mirror of
https://github.com/andwati/kget-capture.git
synced 2026-11-17 09:25:22 +00:00
Get correct filenames, skip KGet's dialog, and add a finished notification
Switch auto-capture from onCreated to onDeterminingFilename, which fires once Chrome has already resolved the real filename (from Content-Disposition or the URL). That name is now passed through to the native host and used to build a full dir+filename destination for addTransfer, replacing showNewTransferDialog. A non-empty destDir makes KGet skip its interactive dialog and start immediately, which also fixes it showing an opaque URL path segment as the filename for signed/obfuscated URLs (e.g. cloud storage links) instead of the real name. Also enable KGet's existing (but disabled-by-default) "Download Finished" KNotify popup via install.sh, so there's still feedback now that captures no longer show an interactive dialog.
This commit is contained in:
+11
@@ -90,6 +90,17 @@ else:
|
||||
print("(If KGet is currently running, restart it for this to take effect.)")
|
||||
PYEOF
|
||||
|
||||
echo "Checking KGet's download-finished notification..."
|
||||
KNOTIFYRC="$HOME/.config/knotifyrc"
|
||||
if [ -f "$KNOTIFYRC" ] && grep -q '^\[Event/kget/finished\]' "$KNOTIFYRC"; then
|
||||
echo "KGet's download-finished notification is already configured, leaving it as-is"
|
||||
elif command -v kwriteconfig6 >/dev/null 2>&1; then
|
||||
kwriteconfig6 --file knotifyrc --group "Event/kget/finished" --key Action Popup
|
||||
echo "Enabled a desktop popup notification for KGet's \"Download Finished\" event"
|
||||
else
|
||||
echo "Skipped: 'kwriteconfig6' not found (not on KDE Plasma?) -- no popup notification set up"
|
||||
fi
|
||||
|
||||
EXT_ID=$(cat "$SCRIPT_DIR/keys/extension-id.txt")
|
||||
|
||||
cat <<EOF
|
||||
|
||||
Reference in New Issue
Block a user