Skip to content

Instantly share code, notes, and snippets.

@fewaltix
Forked from andyrbell/scanner.sh
Last active July 8, 2022 09:45
Show Gist options
  • Save fewaltix/c1437171d16671741aafe146751dbf9f to your computer and use it in GitHub Desktop.
Save fewaltix/c1437171d16671741aafe146751dbf9f to your computer and use it in GitHub Desktop.
Desktop file for linux machines with graphical dialogs based on the scanner.sh script to make a pdf look scanned using ImageMagick
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Categories=Office
Terminal=true
Exec=bash -c 'convert -density 150 "$(zenity --file-selection --title="Select Input File" --file-filter=*[PpDdFf])" -rotate "$([ $((RANDOM % 2)) -eq 1 ] && echo -)0.$(($RANDOM % 4 + 5))" -attenuate 0.4 +noise Multiplicative -attenuate 0.03 +noise Multiplicative -sharpen 0x1.0 -colorspace Gray "$(zenity --file-selection --save --title="Select Output File" --filename ".pdf")"'
Name=FakeScan-Creator
Icon=utilities-terminal
@fewaltix
Copy link
Author

Desktop-File version with file-picking dialog

Can be placed in "/usr/share/applications" on Linux machines to have the script showing up in the starter. Uses zenity for the input and output file dialogs.

The script can of course also be used in the terminal:
convert -density 150 "$(zenity --file-selection --title="Select Input File" --file-filter=*[PpDdFf])" -rotate "$([ $((RANDOM % 2)) -eq 1 ] && echo -)0.$(($RANDOM % 4 + 5))" -attenuate 0.4 +noise Multiplicative -attenuate 0.03 +noise Multiplicative -sharpen 0x1.0 -colorspace Gray "$(zenity --file-selection --save --title="Select Output File" --filename ".pdf")"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment