Skip to content

Instantly share code, notes, and snippets.

@CSaratakij
Last active April 10, 2019 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CSaratakij/c0a3631c8c90581e10fe4ad2a93601fd to your computer and use it in GitHub Desktop.
Save CSaratakij/c0a3631c8c90581e10fe4ad2a93601fd to your computer and use it in GitHub Desktop.
Nautilus convert .pdf to .jpg script intregation (multiple select files support)
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
COUNTER=0
echo -e "Start converting files..."
notify-send "Start converting files..."
for path in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
COUNTER=$(($COUNTER+1))
echo -e "Converting File: $path"
echo -e $path | xargs -i convert -density 300 "$path" "${path%\.pdf}.jpg" &
done
wait
echo -e "Done"
notify-send "Done : convert $COUNTER files"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment