#!/bin/sh
file=$(
  cd "$HOME/documents" || exit 1
  fd --type f . | rofi -dmenu -i -p "documents"
) || exit 0

[ -n "$file" ] || exit 0

path="$HOME/documents/$file"

case "$path" in
  *.pdf|*.PDF)
    exec zathura "$path"
    ;;
  *)
    exec alacritty -e nvim "$path"
    ;;
esac
