Przeglądaj źródła

~/.bin/paper: Find papers interactively

This uses `rofi` to display a list of PDFs in a specific directory.  As
the TODOs note, this could be extended to handle other file types,
directories, ...

Also, no need for `tracker` and similar things, which are much more
heavyweight.  But you do need good file names, otherwise this doesn't
very much.
Lucas Stadler 8 lat temu
rodzic
commit
481b24f8d5
1 zmienionych plików z 22 dodań i 0 usunięć
  1. 22 0
      .bin/paper

+ 22 - 0
.bin/paper

@ -0,0 +1,22 @@
1
#!/bin/sh
2
3
# TODO:
4
#
5
# - default to xdg-open
6
# - make program configurable (`-open-with`, implies `-open`?)
7
# - make opening configurable (`-no-open`)
8
# - make "chooser" configurable (e.g. allow regular dmenu)
9
#
10
# maybe:
11
#
12
# - use fzf if called from an interactive terminal (?)
13
#   - what about scripts called from the commandline, but that should
14
#     display stuff?  probably they don't exist?
15
# - allow multiple directories to be searched
16
17
base="$HOME/d/books/cs"
18
19
paper="$(find "$base" -type f -name '*.pdf' -printf '%P\n' | rofi -dmenu -matching normal -sort -i -markup-rows)"
20
if [ "$?" -eq "0" ]; then
21
	evince "$base/$paper"
22
fi