Skip to content

Some useful Nemo Actions and Shell Scripts with zenity GUIs: 1. Sandwich PDF Maker (OCR, Text Layer, searchable pdf, tesseract, scantailor); 2. PDF Page Rotator; 3. PDF Metadata Editor; 4. PDF Document Downsizer; 5. doc(x), odt, txt to pdf Converter; 6. doc(x) to odt Converter

Alfcx/linux-mint-nemo-actions

Repository files navigation

Linux Mint Nemo Actions by Alfcx

1. Abstract

doc menu pdf menu

Nemo Actions (Linux Mint) or Nautilus Actions (Ubuntu) let you run a command, a script or a program from the context menu (the menu that shows up when you right-click on a file or folder).
This Repository contains Nemo Actions for Linux Mint focused on the postprocessing of scanned documents and document management. The Shell/Zenity Scripts should work on other debian based Distros too. At the moment the GUIs are available in english and german (other languages: ready to translate). The featured Nemo Actions are:

1. PDF Document Page Rotator
Lets you rotate all the pages of a pdf document in one click (more).

2. Scan to Sandwich PDF
This script takes your scanned document (tif or pdf), removes the black borders, splits double pages, corrects the alignement, sets the document to black and white, runs text recognition and adds a text layer to the document. You will end up with a seachable/indexable pdf document. This script backs up the original file in an archive directory too (more).

3. PDF Metadata Editor
Lets you edit the title- and author-tag of a pdf file (more).

4. Pdf Document Downsizer
Reduces the size of your scanned pdf documents and stores the original file in an archive directory (more).

5. doc(x) to odt Converter
Converts Microsoft Office documents (doc, docx) to do documents in the LibreOffice (odt) format (more).

6. doc(x), odt, txt to pdf Converter
Converts your doc, docx, odt and txt documents to pdf files (more).

2. Detailed View on the Nemo Actions in this Repository

2.1 PDF Document Page Rotator

2.1.1 Files

  • pdf-rotator.nemo_action
  • pdf-rotator/pdf-rotator.sh
  • pdf-rotator/lang/de.ini
  • pdf-rotator/lang/en.ini

2.1.2 Description

Lets you rotate all the the pages of a pdf file in one click (90° cw, 90° ccw, 180°). It's ideal for scanned multipage documents.
PDF Rotate
In the background runs this one-liner:

pdftk "INPUT" cat "ROTATION" output "OUTPUT" ;

2.1.3 Prerequisites

Pdftk is used to rotate the pages. Zenity is used to for the GUI.

sudo apt-get update
sudo apt-get install pdftk zenity

2.2 Scan to Sandwich PDF

2.2.1 Files

  • scan-to-sandwich-pdf.nemo_action
  • scan-to-sandwich-pdf/scan-to-sandwich-pdf.sh
  • scan-to-sandwich-pdf/config.ini
  • scan-to-sandwich-pdf/lang/de.ini
  • scan-to-sandwich-pdf/lang/en.ini

2.2.2 Description

Takes your scanned documents (pdf or tif), removes the black border, splits double pages (if necessary), corrects page alignement, sets document to black and white, runs text recognition and adds the text layer to the pdf file. You will end up with a searchable/indexable pdf file, a so called sandwich-pdf file.
If necessary apply the PDF Document Page Rotator first, otherwise the text recognition will fail.

2.2.3 Prerequisites

This Script uses several programs.

sudo apt-get update
sudo apt-get install zenity ghostscript scantailor tesseract-ocr tesseract-ocr-deu tesseract-ocr-fra exactimage pdftk procmail

2.3 PDF Metadata Editor

2.3.1 Files

  • pdf-metadata-editor.nemo_action
  • pdf-metadata-editor/pdf-metadata-editor.sh
  • pdf-metadata-editor/lang/de.ini
  • pdf-metadata-editor/lang/en.ini

2.3.2 Description

Lets you edit the author- and the title-tag of a pdf file.
PDF Metadata Edit 1 PDF Metadata Edit 2

2.3.3 Prerequisites

Pdftk is used to work the pdf file. Zenity is used to for the GUI.

sudo apt-get update
sudo apt-get install pdftk zenity

2.4 PDF Document Downsizer

2.4.1 Files

  • pdf-downsizer.nemo_action
  • pdf-downsizer/pdf-downsizer.sh
  • pdf-downsizer/config.ini
  • pdf-downsizer/lang/en.ini
  • pdf-downsizer/lang/de.ini

2.4.2 Description

Reduces the size of your scanned pdf files by running this ghostscript one-liner on the document:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -sOutputFile="OUTPUTFILE" "INPUTFILE" ;

Also makes a backup of the original file in an archive directory (default: /home/$USER/Scan-Archive; will be created, if it doesn't exist).
You don't need to run this script on files you edited with Scan to Sandwich PDF (this script already downsizes the pdf files).

2.4.3 Prerequisites

Ghostscript is used to work the pdf file. Zenity is used to for the GUI.

sudo apt-get update
sudo apt-get install ghostscript zenity

2.5 doc(x) to odt Converter

2.5.1 Files

  • convert-doc-to-odt.nemo_action

2.5.2 Description

Converts Microsoft Office Documents (doc and docx) to Documents in the LibreOffice Format (odt) by

unoconv -f odt "YOURFILE"

2.5.3 Prerequisites

Unoconv is used to convert the files.

sudo apt-get update
sudo apt-get install unoconv

2.6 doc(x), odt, txt to pdf Converter

2.6.1 Files

  • convert-to-pdf.nemo_action

2.6.2 Description

Converts doc, docx, odt and txt files to pdf by

unoconv "YOURFILE"

2.6.3 Prerequisites

Unoconv is used to convert the files.

sudo apt-get update
sudo apt-get install unoconv

2.7 PDF Merger

2.7.1 Files

  • pdf-merger.nemo_action
  • pdf-merger/pdf-merger.sh
  • pdf-merger/config.ini
  • pdf-merger/lang/de.ini
  • pdf-merger/lang/en.ini

2.7.2 Description

Combines multiple marked pdf files in alphabetical order to one pdf file. In the background pdftk does the magic:
pdftk INPUT1 INPUT2 INPUT3 cat output "OUTPUT"
You can choose if the input files should be deleted after processing or not (in the config.ini).
You have to run this script out of a nemo window. If you mark the files direct on the desktop the order will be messed up.

2.7.3. Prerequisites

Pdftk is used to build the file. Zenity is used for the GUI.

sudo apt-get update
sudo apt-get install pdftk zenity

3. Install Nemo Actions from this Repository

  1. Fire up a terminal; make a directory, where you can store the files from this repository; enter this directory:
mkdir ~/Downloads/linux-mint-nemo-actions
cd ~/Downloads/linux-mint-nemo-actions
  1. Clone the files from this repository to your computer.
git clone https://github.com/Alfcx/linux-mint-nemo-actions
  1. Make sure you have the necessary programs (for the nemo action you want) installed on your system. E.g. for the sandwich-pdf nemo action you'll have to run:
sudo apt-get update
sudo apt-get install zenity ghostscript scantailor tesseract-ocr tesseract-ocr-deu tesseract-ocr-fra exactimage pdftk
  1. Copy the files and folders for the wanted nemo action to your nemo actions directory. Linux Mint stores the Nemo Actions in ~/.local/share/nemo/actions (user) and /usr/share/nemo/actions (system-wide). Also make sure the shell script is executable. E.g. for the "scan to sandwich pdf" nemo action you'll have to run:
cp scan-to-sandwich-pdf.nemo_action ~/.local/share/nemo/actions
mkdir ~/.local/share/nemo/actions/scan-to-sandwich-pdf
cp -r scan-to-sandwich-pdf/* ~/.local/share/nemo/actions/scan-to-sandwich-pdf
chmod +x ~/.local/share/nemo/actions/scan-to-sandwich-pdf/scan-to-sandwich-pdf.sh
  1. You should now be able to see your Nemo Action in the context menu (e.g. you'll see "Create Sandwich-PDF" when you right-click on a pdf file). If you don't see the Nemo Action, log out and back in. Have Fun with this Nemo Actions and let me know if they work for you.

About

Some useful Nemo Actions and Shell Scripts with zenity GUIs: 1. Sandwich PDF Maker (OCR, Text Layer, searchable pdf, tesseract, scantailor); 2. PDF Page Rotator; 3. PDF Metadata Editor; 4. PDF Document Downsizer; 5. doc(x), odt, txt to pdf Converter; 6. doc(x) to odt Converter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages