#!/bin/sh -e
readonly kanako_conf_dir="${conf_dir:-$HOME/.config/kanako}"
readonly kanako_store_dir="${store_dir:-$HOME/.kanako-store}"

if test -f "${kanako_conf_dir}"/kanako.conf; then
    . "${kanako_conf_dir}"/kanako.conf
else
    echo "Configuration file has not been found!"
    exit 1
fi

find . -name '*.enc' | sort | sed 's,^\./,,;s,\.enc$,,' | "${kanako_menu_cmd}" | xargs $(which kanako) -c
