- Timestamp:
- Oct 11, 2022, 6:53:26 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kanako
r3 r4 23 23 24 24 fn_copy() { 25 fn_view $ 2 | ${clip}25 fn_view $1 | ${clip_cmd} 26 26 } 27 27 fn_edit() { 28 ${decrypt_cmd} ${decrypt_args} ${1%%.enc}.enc 28 ${decrypt_cmd} ${decrypt_args} ${1%%.enc}.enc > ${1%%.enc} 29 29 ${EDITOR} ${1%%.enc} 30 ${encrypt_cmd} ${encrypt_args} ${1%%.enc} 30 ${encrypt_cmd} ${encrypt_args} ${1%%.enc} > ${1%%.enc}.enc 31 31 rm ${1%%.enc} 32 32 } … … 35 35 } 36 36 fn_list() { 37 if command -v tree 2>/dev/null; then 38 tree ${store_dir} 39 else 40 ls -l ${store_dir} 41 fi 37 ${list_cmd} ${store_dir} 42 38 } 43 39 fn_new() { … … 48 44 49 45 mkdir -p $(dirname $1) 50 ${encrypt_cmd} ${encrypt_args} ${tmpfile} 51 52 mv ${tmpfile}.enc ${1%%.enc}.enc 46 ${encrypt_cmd} ${encrypt_args} ${tmpfile} > ${1%%.enc}.enc 53 47 rm ${tmpfile} 54 48 } … … 62 56 cat <<EOF 63 57 Usage: 64 ayu[-ceglnrRv] <arguments>65 ayu[copy|edit|gen|list|add|trash|trashd|view] <arguments>58 kanako [-ceglnrRv] <arguments> 59 kanako [copy|edit|gen|list|add|trash|trashd|view] <arguments> 66 60 EOF 61 } 62 fn_view() { 63 if [ -f ${1%%.enc}.enc ]; then 64 ${encrypt_cmd} ${decrypt_args} ${1%%.enc}.enc 65 elif [ -d ${1:-.} ]; then 66 ${list_cmd} ${1:-.} 67 else 68 fn_usage 69 fi 67 70 } 68 71 -
trunk/kanako.conf.example
r2 r4 1 1 # [General] 2 2 #clip="xclip -i" 3 #clip="wl-copy --primary" 4 #list_cmd="tree" 3 5 4 6 # [Encryption] -
trunk/kanako.conf.mdoc
r2 r4 9 9 .Ss General section 10 10 .Bl -tag -width 11n -compact 11 .It clip 12 Clipboard program to use with 13 the program. Default is xclip 11 .It clip_cmd 12 Clipboard executable to use with 13 the program. 14 .It list_cmd 15 Listing executable to use 16 with the program. 14 17 .El 15 18 .Ss Encryption section … … 17 20 .It encrypt_cmd 18 21 Command to handle encryption 19 Default is 'age'20 22 .It encrypt_args 21 23 Options to be passed to
Note:
See TracChangeset
for help on using the changeset viewer.