#!/bin/sh

prefix=$HOME/Nextcloud/Books/
# dmenu="pipemenu --title Books"
# dmenu="fuzzel -d -p books -w 80"
dmenu="bemenu -p books --center --list 20 down --width-factor 0.5 --border 2 --bdr #f6c2e7"
pdf=zathura
# pdf="flatpak run org.gnome.Papers"

choice=$(find $prefix -type f | sed "s|$prefix||;s/_/ /g" | $dmenu)

test -n "$choice" && $pdf $(echo $choice | sed "s/ /_/g;s|^|$prefix|") &
