Changeset 18 in code for trunk


Ignore:
Timestamp:
Aug 24, 2023, 2:36:05 AM (22 months ago)
Author:
yakumo.izuru
Message:

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

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

Location:
trunk
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r17 r18  
    1 include config.mk
     1PREFIX=/usr/local
    22
    33install: install-bin install-examples install-man
     
    55
    66install-bin:
    7         install -Dm${EXEC_MODE} kanako ${PREFIX}/bin/kanako
     7        install -Dm0755 kanako ${DESTDIR}${PREFIX}/bin/kanako
    88install-examples:
    9         install -Dm${FILE_MODE} kanako.conf.example ${PREFIX}/share/examples/kanako/kanako.conf
     9        install -Dm0600 kanako.conf.example ${DESTDIR}${PREFIX}/share/examples/kanako/kanako.conf
    1010install-man:
    11         install -Dm${FILE_MODE} kanako.mdoc ${PREFIX}/share/man/man1/kanako.1
    12         install -Dm${FILE_MODE} kanako.conf.mdoc ${PREFIX}/share/man/man5/kanako.conf.5
     11        install -Dm0600 kanako.mdoc ${DESTDIR}${PREFIX}/share/man/man1/kanako.1
     12        install -Dm0600 kanako.conf.mdoc ${DESTDIR}${PREFIX}/share/man/man5/kanako.conf.5
    1313uninstall-bin:
    1414        rm -f ${PREFIX}/bin/kanako
  • trunk/README.md

    r17 r18  
    1010## Dependencies
    1111* Any of the above, depending how you configured it
    12 * `ls(1)` or `tree(1)` for printing a list
     12* `tree(1)` for printing a list
    1313* `mandoc(1)` for documentation
    1414
     
    3232
    3333## Related software
    34 * [akoizumi/ayu](https://git.shelltalk.net/akoizumi/ayu) [predecessor]
    3534* [beastie/aps](https://codeberg.org/beastie/aps)
    3635* [biox/pa](https://github.com/biox/pa)
  • trunk/kanako

    r17 r18  
    11#!/bin/sh
    2 # $TheSupernovaDuo: kanako,v 1.9 2023/5/18 21:9:33 yakumo_izuru Exp $
     2# $TheSupernovaDuo: kanako,v 2.0 2023/08/23 23:33:45 yakumo_izuru Exp $
    33
    44readonly kanako_conf_dir="${kanako_conf_dir:-$HOME/.config/kanako}"
     
    2323fi
    2424
    25 fn_copy() {
    26     fn_view $1 | "${kanako_clip_cmd}"
     25copy() {
     26    view $1 | "${kanako_clip_cmd}"
    2727}
    28 fn_edit() {
     28edit() {
    2929    ${kanako_encrypt_cmd} ${kanako_decrypt_args} ${1%%.enc}.enc > ${1%%.enc}
    3030    "${EDITOR}" "${1%%.enc}"
     
    3232    rm "${1%%.enc}"
    3333}
    34 fn_list() {
    35     "${kanako_list_cmd}" "${kanako_store_dir}/"
     34list() {
     35    $(which tree) "${kanako_store_dir}/"
    3636}
    37 fn_new() {
    38     test -d $1 && fn_usage && exit 1
     37new() {
     38    test -d $1 && usage && exit 1
    3939
    4040    tmpfile="$(mktemp)"
     
    4545    rm ${tmpfile}
    4646}
    47 fn_trash_directory() {
    48     rm -rf "$1"
     47trash_directory() {
     48    rm -r -I "$1"
    4949}
    50 fn_trash_file() {
    51     rm -f "${1}${2}".enc
     50trash_file() {
     51    rm -i "${1}${2}".enc
    5252}
    53 fn_usage() {
     53usage() {
    5454    printf "Usage: %s [-c|-e|-h|-l|-n|-R|-r|-v [file or directory]]\n" "$0"
    5555    printf "The arguments for all switches except for '-h' are relative to\n"
    5656    printf "\t\$kanako_store_dir which is set to %s\n\n" "{$kanako_store_dir}"
    5757}
    58 fn_view() {
     58view() {
    5959    if [ -f "${1%%.enc}".enc ]; then
    6060        ${kanako_encrypt_cmd} ${kanako_decrypt_args} "${1%%.enc}".enc
    6161    elif [ -d "${1:-.}" ]; then
    62         ${kanako_list_cmd} "${1:-.}"
     62        $(which tree) "${1:-.}"
    6363    else
    64         fn_usage
     64        usage
    6565    fi   
    6666}
    6767
    6868case $1 in
    69     -c) fn_copy $2 ;;
    70     -e) fn_edit $2 ;;
    71     -l) fn_list ;;
    72     -n) fn_new $2 ;;
    73     -R) fn_trash_directory $2 ;;
    74     -r) fn_trash_file $2 ;;
    75     -v) fn_view $2 ;;
    76     *) fn_usage ;;
     69    -c) copy $2 ;;
     70    -e) edit $2 ;;
     71    -l) list ;;
     72    -n) new $2 ;;
     73    -R) trash_directory $2 ;;
     74    -r) trash_file $2 ;;
     75    -v) view $2 ;;
     76    *) usage ;;
    7777esac
  • trunk/kanako.conf.example

    r15 r18  
    33#kanako_clip_cmd="xclip -i"
    44#kanako_clip_cmd="wl-copy --primary"
    5 #kanako_list_cmd="tree"
    65#kanako_menu_cmd="dmenu"
    76
  • trunk/kanako.conf.mdoc

    r15 r18  
    1 .Dd Aftermath 41, 3188
     1.Dd $Mdocdate$
    22.Dt KANAKO.CONF 5
    33.Os
     
    2020Encryption executable to
    2121be used with the program
    22 .It kanako_list_cmd
    23 Listing executable to
    24 be used with the -l switch
    2522.It kanako_menu_cmd
    2623Menu executable to
     
    3027.Xr kanako 1
    3128.Sh AUTHORS
    32 .An Aoi Koizumi Aq Mt koizumi.aoi@kyoko-project.wer.ee
     29.An Izuru Yakumo Aq Mt yakumo.izuru@chaotic.ninja
    3330 
  • trunk/kanako.mdoc

    r15 r18  
    1 .Dd Bureaucracy 73, 3188
     1.Dd $Mdocdate$
    22.Dt KANAKO 1
    33.Os
     
    3434List all entries
    3535.It -r
    36 Remove single entries
     36Remove single entries,
     37will prompt for confirmation
    3738.It -R
    38 Remove recursively a directory w/ entries
     39Remove recursively a directory w/ entries,
     40will prompt for confirmation
    3941.It -v
    4042View an entry
     
    5557.Re
    5658.Sh AUTHORS
    57 .An Aoi Koizumi Aq Mt koizumi.aoi@kyoko-project.wer.ee
     59.An Izuru Yakumo Aq Mt yakumo.izuru@chaotic.ninja
    5860.Sh BUGS
    5961Under the Wayland display protocol,
  • trunk/mkfile

    r14 r18  
    1 <config.mk
     1PREFIX=/usr/local
    22
    33install:V: install-bin install-examples install-man
     
    55
    66install-bin:
    7         install -Dm$EXEC_MODE kanako $PREFIX/bin/kanako
     7        install -Dm0755 kanako $DESTDIR$PREFIX/bin/kanako
    88install-examples:
    9         install -Dm$FILE_MODE kanako.conf.example $PREFIX/share/examples/kanako/kanako.conf
     9        install -Dm0600 kanako.conf.example $DESTDIR$PREFIX/share/examples/kanako/kanako.conf
    1010install-man:
    11         install -Dm$FILE_MODE kanako.mdoc $PREFIX/share/man/man1/kanako.1
    12         install -Dm$FILE_MODE kanako.conf.mdoc $PREFIX/share/man/man5/kanako.conf.5
     11        install -Dm0600 kanako.mdoc $DESTDIR$PREFIX/share/man/man1/kanako.1
     12        install -Dm0600 kanako.conf.mdoc $DESTDIR$PREFIX/share/man/man5/kanako.conf.5
    1313uninstall-bin:
    1414        rm -f $PREFIX/bin/kanako
Note: See TracChangeset for help on using the changeset viewer.