#!/bin/sh

prefix=$HOME/Nextcloud/Papers/
dmenu="bemenu -p papers --center --list 20 down --width-factor 0.5 --border 2 --bdr #fabd2f"
# pdf=zathura
pdf=sioyek
# 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|") &
