Skip to content

Commit

Permalink
Add instructions for Keyboard-Shortcut launch in Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre B committed Nov 10, 2018
1 parent 86b0520 commit d25431f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -6,6 +6,7 @@ Quickly find and open a pdf among a collection of thousands of unsorted pdfs thr
- [Installation on OSX](#installation-on-osx-with-homebrew)
- [Usage](#usage)
- [How to clear the cache?](#how-to-clear-the-cache)
- [Launch with keyboard shortcut in Ubuntu](#launch-with-keyboard-shortcut-in-ubuntu)
- [See it in action](#see-it-in-action)
- [Is the historical bash code still available?](#is-the-historical-bash-code-still-available)

Expand Down Expand Up @@ -95,6 +96,22 @@ To clear the cache (which contains text extracted from PDF), you may safely remo
``~/.cache/fast-p-pdftotext-output/fast-p_cached_pdftotext_output.db``, or
``~/.cache/fast-p_cached_pdftotext_output.db`` in older version.

# Launch with keyboard shortcut in Ubuntu

On Ubuntu desktop (tested in 18.04), one may add a keyboard shortcut to launch a new terminal running the ``p`` command right away.
With the following script, the new terminal window will automatically close after choosing a PDF.

Create a file ``~/.fast-p-rc`` with
```
source .bashrc
p;
sleep 0.15; exit;
```
and in Ubuntu Settings/Keyboard, add a custom shortcut that runs the command
``gnome-terminal -- sh -c "bash --rcfile .fast-p-rc"``.



# See it in action

![illustration of the p command](https://user-images.githubusercontent.com/1019692/34446795-12229072-ecac-11e7-856a-ec0df0de60ae.gif)
Expand Down

0 comments on commit d25431f

Please sign in to comment.