summaryrefslogtreecommitdiff
path: root/extract_pdfs
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2026-01-18 11:44:26 +0100
committerfilip <“filip.rabiega@gmail.com”>2026-01-18 11:44:26 +0100
commit83954961af8b6337da100e038561f2fd975ac1fe (patch)
tree33a45dbf91cc4c0b8975287b9537db8aa272505f /extract_pdfs
parentafd02bfcce54e3252d356f34c25a155c855f3612 (diff)
downloadchadscripts-master.tar.gz
chadscripts-master.tar.bz2
chadscripts-master.zip
huge changesHEADmaster
Diffstat (limited to 'extract_pdfs')
-rwxr-xr-xextract_pdfs33
1 files changed, 0 insertions, 33 deletions
diff --git a/extract_pdfs b/extract_pdfs
deleted file mode 100755
index 2fb0d49..0000000
--- a/extract_pdfs
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/zsh
-
-if [ "$#" -ne 2 ]; then
- echo "Usage: extract_pdfs /path/to/source /path/to/destination"
- exit 1
-fi
-
-SOURCE_DIR="$1"
-DEST_DIR="$2"
-
-if [ ! -d "$SOURCE_DIR" ]; then
- notify-send "Source directory does not exist: $SOURCE_DIR"
- exit 1
-fi
-
-mkdir -p "$DEST_DIR"
-
-find "$SOURCE_DIR" -type f -iname "*.pdf" | while read -r pdf; do
- filename=$(basename "$pdf")
-
- dest_file="$DEST_DIR/$filename"
- if [ -e "$dest_file" ]; then
- i=1
- while [ -e "$DEST_DIR/${filename%.*}_$i.pdf" ]; do
- ((i++))
- done
- dest_file="$DEST_DIR/${filename%.*}_$i.pdf"
- fi
-
- cp "$pdf" "$dest_file"
-done
-
-notify-send "PDF extraction complete. Files copied to: $DEST_DIR"