Skip to content

Instantly share code, notes, and snippets.

@Frankenmint
Last active January 14, 2026 20:51
Show Gist options
  • Select an option

  • Save Frankenmint/1dab403420726ae495415c295e2df30b to your computer and use it in GitHub Desktop.

Select an option

Save Frankenmint/1dab403420726ae495415c295e2df30b to your computer and use it in GitHub Desktop.
editDown.sh
#!/usr/bin/env bash
set -e
# Capture the directory where the script was launched
WORKDIR="$PWD"
PROJECT_NAME=$(basename "$WORKDIR")
PROJECT_FILE="${WORKDIR}/${PROJECT_NAME}.kdenlive"
# Step 1 — check for existing kdenlive file
if [[ -f "$PROJECT_FILE" ]]; then
echo "file exists!"
exit 1
fi
# Step 2 — go into CLIP folder
cd "$WORKDIR/CLIP" || { echo "CLIP folder not found"; exit 1; }
# Step 3 — find newest C*.MP4
INPUT=$(ls -t C*.MP4 2>/dev/null | head -n 1)
if [[ -z "$INPUT" ]]; then
echo "No C*.MP4 files found"
exit 1
fi
echo "Using input: $INPUT"
# Step 4 — run auto-editor
auto-editor "$INPUT" --edit audio --export kdenlive --margin 0.2s
# Step 5 — grab the generated project
OUTPUT=$(ls -t *.kdenlive | head -n 1)
if [[ -z "$OUTPUT" ]]; then
echo "No kdenlive file produced"
exit 1
fi
# Step 6 — move & rename it
mv "$OUTPUT" "$PROJECT_FILE"
echo "process complete!"
# Step 7 — launch Kdenlive with the project
kdenlive "$PROJECT_FILE" >/dev/null 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment