Created
November 11, 2018 21:41
-
-
Save nemanjan00/cb27ac9814c55fd5b98979042ede7db8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code runs like a charm. Thanks!