Skip to content

Instantly share code, notes, and snippets.

@nemanjan00
Created November 11, 2018 21:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemanjan00/cb27ac9814c55fd5b98979042ede7db8 to your computer and use it in GitHub Desktop.
Save nemanjan00/cb27ac9814c55fd5b98979042ede7db8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
LIBRARY="$HOME/Library"
function display() {
books=$(find $LIBRARY | grep '\.epub\|\.pdf')
books=${books//$LIBRARY/"~"}
line=$(echo "$books" | rofi -matcher fuzzy -dmenu -i -p "book> ")
exit_code=$?
line="${line/\~/$LIBRARY}"
if [ $exit_code == 0 ]; then
zathura "${line}"
echo $line
fi
}
display
@rjachuthan
Copy link

This code runs like a charm. Thanks!

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