A bash script to search for a keyword in PDF files in the folders specified in the configuration file.
./pdf_finder.sh [OPTIONS] [KEYWORD]
-help
: Display the help message.-addDir [FOLDER]
: Add a directory to the configuration file.-removeDir [FOLDER]
: Remove a directory from the configuration file.-listDir
: List the directories in the configuration file.-resetConfig
: Reset the configuration file.-resetHistory
: Reset the history file.-history
: Display the history file.
The script reads the configuration file from ~/.config/pdf_search/config.txt. If the file does not exist, the script will create it.
The configuration file contains the list of directories to search in. Each directory must be on a separate line.
The script store the history of the search in the file ~/.config/pdf_search/history.txt. If the file does not exist, the script will create it.
Add a directory to the configuration file:
./pdf_finder.sh -addDir /path/to/directory
Remove a directory from the configuration file:
./pdf_finder.sh -removeDir /path/to/directory
List the directories in the configuration file:
./pdf_finder.sh -listDir
Reset the configuration file:
./pdf_finder.sh -resetConfig
Reset the history file:
./pdf_finder.sh -resetHistory
Display the history file:
./pdf_finder.sh -history
rofi
: Used to display the results.ripgrep
: Used to search for the keyword in the PDF files.
To install the dependencies on Ubuntu:
sudo apt install rofi
sudo apt install ripgrep
Note: The script will check if the dependencies are installed. If not, the script will display an error message and exit.
To install the script, clone the repository and copy the script to a directory in your PATH.