New major release, ironically enough, no major changes done yet

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: file:///srv/svn/repo/kanako/trunk@18 62e5d677-aa6e-8c4a-b8cb-b9416171cb8e
This commit is contained in:
yakumo.izuru 2023-08-24 02:36:05 +00:00
parent b9bd346535
commit 8fcbaa3e98
8 changed files with 44 additions and 50 deletions

View File

@ -1,15 +1,15 @@
include config.mk
PREFIX=/usr/local
install: install-bin install-examples install-man
uninstall: uninstall-bin uninstall-examples uninstall-man
install-bin:
install -Dm${EXEC_MODE} kanako ${PREFIX}/bin/kanako
install -Dm0755 kanako ${DESTDIR}${PREFIX}/bin/kanako
install-examples:
install -Dm${FILE_MODE} kanako.conf.example ${PREFIX}/share/examples/kanako/kanako.conf
install -Dm0600 kanako.conf.example ${DESTDIR}${PREFIX}/share/examples/kanako/kanako.conf
install-man:
install -Dm${FILE_MODE} kanako.mdoc ${PREFIX}/share/man/man1/kanako.1
install -Dm${FILE_MODE} kanako.conf.mdoc ${PREFIX}/share/man/man5/kanako.conf.5
install -Dm0600 kanako.mdoc ${DESTDIR}${PREFIX}/share/man/man1/kanako.1
install -Dm0600 kanako.conf.mdoc ${DESTDIR}${PREFIX}/share/man/man5/kanako.conf.5
uninstall-bin:
rm -f ${PREFIX}/bin/kanako
uninstall-examples:

View File

@ -9,7 +9,7 @@ the adaptable password manager. named after [Kanako Yasaka](https://en.touhouwik
## Dependencies
* Any of the above, depending how you configured it
* `ls(1)` or `tree(1)` for printing a list
* `tree(1)` for printing a list
* `mandoc(1)` for documentation
## Add-ons
@ -31,7 +31,6 @@ from oath-toolkit.
* [Beerware License (Revision 42.1)](COPYING)
## Related software
* [akoizumi/ayu](https://git.shelltalk.net/akoizumi/ayu) [predecessor]
* [beastie/aps](https://codeberg.org/beastie/aps)
* [biox/pa](https://github.com/biox/pa)
* [e-zk/page](https://github.com/e-zk/page)

View File

@ -1,3 +0,0 @@
EXEC_MODE=0755
FILE_MODE=0600
PREFIX=/usr/local

48
kanako
View File

@ -1,5 +1,5 @@
#!/bin/sh
# $TheSupernovaDuo: kanako,v 1.9 2023/5/18 21:9:33 yakumo_izuru Exp $
# $TheSupernovaDuo: kanako,v 2.0 2023/08/23 23:33:45 yakumo_izuru Exp $
readonly kanako_conf_dir="${kanako_conf_dir:-$HOME/.config/kanako}"
readonly kanako_key_dir="${kanako_key_dir:-$HOME/.kanako}"
@ -22,20 +22,20 @@ else
exit 1
fi
fn_copy() {
fn_view $1 | "${kanako_clip_cmd}"
copy() {
view $1 | "${kanako_clip_cmd}"
}
fn_edit() {
edit() {
${kanako_encrypt_cmd} ${kanako_decrypt_args} ${1%%.enc}.enc > ${1%%.enc}
"${EDITOR}" "${1%%.enc}"
${kanako_encrypt_cmd} ${kanako_encrypt_args} ${1%%.enc} > ${1%%.enc}.enc
rm "${1%%.enc}"
}
fn_list() {
"${kanako_list_cmd}" "${kanako_store_dir}/"
list() {
$(which tree) "${kanako_store_dir}/"
}
fn_new() {
test -d $1 && fn_usage && exit 1
new() {
test -d $1 && usage && exit 1
tmpfile="$(mktemp)"
"${EDITOR}" "${tmpfile}"
@ -44,34 +44,34 @@ fn_new() {
${kanako_encrypt_cmd} ${kanako_encrypt_args} ${tmpfile} > ${1%%.enc}.enc
rm ${tmpfile}
}
fn_trash_directory() {
rm -rf "$1"
trash_directory() {
rm -r -I "$1"
}
fn_trash_file() {
rm -f "${1}${2}".enc
trash_file() {
rm -i "${1}${2}".enc
}
fn_usage() {
usage() {
printf "Usage: %s [-c|-e|-h|-l|-n|-R|-r|-v [file or directory]]\n" "$0"
printf "The arguments for all switches except for '-h' are relative to\n"
printf "\t\$kanako_store_dir which is set to %s\n\n" "{$kanako_store_dir}"
}
fn_view() {
view() {
if [ -f "${1%%.enc}".enc ]; then
${kanako_encrypt_cmd} ${kanako_decrypt_args} "${1%%.enc}".enc
elif [ -d "${1:-.}" ]; then
${kanako_list_cmd} "${1:-.}"
$(which tree) "${1:-.}"
else
fn_usage
usage
fi
}
case $1 in
-c) fn_copy $2 ;;
-e) fn_edit $2 ;;
-l) fn_list ;;
-n) fn_new $2 ;;
-R) fn_trash_directory $2 ;;
-r) fn_trash_file $2 ;;
-v) fn_view $2 ;;
*) fn_usage ;;
-c) copy $2 ;;
-e) edit $2 ;;
-l) list ;;
-n) new $2 ;;
-R) trash_directory $2 ;;
-r) trash_file $2 ;;
-v) view $2 ;;
*) usage ;;
esac

View File

@ -2,7 +2,6 @@
#kanako_clip_cmd="xclip -i"
#kanako_clip_cmd="wl-copy --primary"
#kanako_list_cmd="tree"
#kanako_menu_cmd="dmenu"
## age
@ -23,4 +22,4 @@
## salty
#kanako_encrypt_cmd="salty"
#kanako_encrypt_args="-e -r $(cat ${kanako_key_dir}/pub.slt)"
#kanako_decrypt_args="-d -i ${kanako_key_dir}/priv.slt"
#kanako_decrypt_args="-d -i ${kanako_key_dir}/priv.slt"

View File

@ -1,4 +1,4 @@
.Dd Aftermath 41, 3188
.Dd $Mdocdate$
.Dt KANAKO.CONF 5
.Os
.Sh NAME
@ -19,9 +19,6 @@ passed to kanako_encrypt_cmd
.It kanako_encrypt_cmd
Encryption executable to
be used with the program
.It kanako_list_cmd
Listing executable to
be used with the -l switch
.It kanako_menu_cmd
Menu executable to
be used with kanako_menu
@ -29,5 +26,5 @@ be used with kanako_menu
.Sh SEE ALSO
.Xr kanako 1
.Sh AUTHORS
.An Aoi Koizumi Aq Mt koizumi.aoi@kyoko-project.wer.ee
.An Izuru Yakumo Aq Mt yakumo.izuru@chaotic.ninja

View File

@ -1,4 +1,4 @@
.Dd Bureaucracy 73, 3188
.Dd $Mdocdate$
.Dt KANAKO 1
.Os
.Sh NAME
@ -33,9 +33,11 @@ Edit an entry
.It -l
List all entries
.It -r
Remove single entries
Remove single entries,
will prompt for confirmation
.It -R
Remove recursively a directory w/ entries
Remove recursively a directory w/ entries,
will prompt for confirmation
.It -v
View an entry
.Bl
@ -54,7 +56,7 @@ View an entry
.%D 1983
.Re
.Sh AUTHORS
.An Aoi Koizumi Aq Mt koizumi.aoi@kyoko-project.wer.ee
.An Izuru Yakumo Aq Mt yakumo.izuru@chaotic.ninja
.Sh BUGS
Under the Wayland display protocol,
the clipboard subcommand won't work,

10
mkfile
View File

@ -1,15 +1,15 @@
<config.mk
PREFIX=/usr/local
install:V: install-bin install-examples install-man
uninstall:V: uninstall-bin uninstall-examples uninstall-man
install-bin:
install -Dm$EXEC_MODE kanako $PREFIX/bin/kanako
install -Dm0755 kanako $DESTDIR$PREFIX/bin/kanako
install-examples:
install -Dm$FILE_MODE kanako.conf.example $PREFIX/share/examples/kanako/kanako.conf
install -Dm0600 kanako.conf.example $DESTDIR$PREFIX/share/examples/kanako/kanako.conf
install-man:
install -Dm$FILE_MODE kanako.mdoc $PREFIX/share/man/man1/kanako.1
install -Dm$FILE_MODE kanako.conf.mdoc $PREFIX/share/man/man5/kanako.conf.5
install -Dm0600 kanako.mdoc $DESTDIR$PREFIX/share/man/man1/kanako.1
install -Dm0600 kanako.conf.mdoc $DESTDIR$PREFIX/share/man/man5/kanako.conf.5
uninstall-bin:
rm -f $PREFIX/bin/kanako
uninstall-examples: