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

if test -f "${conf_dir}"/kanakomenu.conf; then
    . "${conf_dir}"/kanakomenu.conf
else
    echo "Configuration file has not been found!"
    echo "Copy kanakomenu.conf from the examples directory,"
    echo "and edit accordingly"
    exit 1
fi

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