Initial commit

This commit is contained in:
2026-09-26 20:58:21 +02:00
commit 38ac56379f
3 changed files with 91 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
for f in *.DNG; do [ ! -f "${f%.DNG}.JPG" ] && echo "Will remove $f"; done
read -p "Proceed? " answer
case $answer in
[Yy]* ) for f in *.DNG; do [ ! -f "${f%.DNG}.JPG" ] && rm "$f"; done; exit;;
[Nn]* ) echo "Quitting.."; exit;;
esac
Executable
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
case "$1" in
-t)
sleep 0.2
ydotool type "andrea.ferronato@telosalliance.com"
;;
-m)
sleep 0.2
ydotool type "ferronato.andre@gmail.com"
;;
-l)
sleep 0.2
ydotool type "andrea.ferronato@live.com"
;;
-f)
sleep 0.2
ydotool type "andrea@faerro.it"
;;
-p)
sleep 0.2
ydotool type "andrea.ferronato@arubapec.it"
;;
esac
+58
View File
@@ -0,0 +1,58 @@
#!/bin/bash
# 1. Check if both arguments were provided
if [ -z "$1" ]; then
echo "Error: Source folder not specified."
echo "Usage: $0 <source_folder> <output_folder>"
exit 1
fi
if [ -z "$2" ]; then
echo "Error: Output folder not specified."
echo "Usage: $0 <source_folder> <output_folder>"
exit 1
fi
# 2. Assign arguments to variables and resolve absolute paths
TARGET_DIR=$(cd "$1" 2>/dev/null && pwd)
# 3. Check if the input directory actually exists
if [ -z "$TARGET_DIR" ]; then
echo "Error: Source directory '$1' does not exist."
exit 1
fi
# Set the final output path explicitly *before* creating or checking it
OUTPUT_DIR="$2/pdfa"
# 4. Create the output directory if it doesn't exist
# This is the crucial fix for Ghostscript!
if [ ! -d "$OUTPUT_DIR" ]; then
echo "Creating output directory: $OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR"
fi
echo "Processing PDFs in: $TARGET_DIR"
echo "Saving outputs to: $OUTPUT_DIR"
echo "----------------------------------------"
# 5. Loop through all PDF files (case-insensitive)
shopt -s nullglob nocaseglob
for pdf in "$TARGET_DIR"/*.pdf; do
filename=$(basename "$pdf")
echo "Processing: $filename..."
# Run Ghostscript
gs -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/ebook \
-dNOPAUSE \
-dQUIET \
-dBATCH \
-sOutputFile="$OUTPUT_DIR/$filename_converted" "$pdf"
done
shopt -u nullglob nocaseglob
echo "----------------------------------------"
echo "Done! Converted files are in: $OUTPUT_DIR"