From f032c324a37d640d8ad55be2cbac077718fe85f3 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Thu, 2 Mar 2023 14:42:16 +0800 Subject: Update --- alias | 2 +- bin/wiki/diary | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alias b/alias index 9064cc5..c89c0ff 100644 --- a/alias +++ b/alias @@ -297,7 +297,7 @@ alias b='bean' alias cdl='cd ~/log' alias chw='tig -C ~/log' ww() { entry="${1:-guideline}"; vim -c Goyo ~/log/${entry%%.md}.md; } -wg() { grep -r "$@" --color --exclude-dir={logseq,.git} ~/log; } +wg() { grep -r "$@" --color --exclude-dir={logseq,.git,.obsidian} ~/log; } wi() { cat ~/log/${1%%.md}.md; } alias dia='diary' alias dias='diary specify' diff --git a/bin/wiki/diary b/bin/wiki/diary index 3995ecf..41b3e08 100755 --- a/bin/wiki/diary +++ b/bin/wiki/diary @@ -3,7 +3,7 @@ today=~/log/`date +%y.w%W.md` specify_date() { - YEAR=${YEAR:-22} + YEAR=${YEAR:-23} while read -e -p 'Month? ' -r MONTH /dev/null && break done - FILE=~/log/diary/20$YEAR-$MONTH-$DAY.md + FILE=~/log/diary/`date -d $YEAR-$MONTH-$DAY +%y.w%W.md` vim -c 'Goyo' $FILE } -- cgit v1.2.3-70-g09d2 From 4150a1aec6869abd6e86eee6bb080b42acc9cdfe Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sat, 4 Mar 2023 15:29:29 +0800 Subject: Fix gpg passphase check --- X11/rofi/pass.get | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/X11/rofi/pass.get b/X11/rofi/pass.get index 80dc0cc..9aaf542 100755 --- a/X11/rofi/pass.get +++ b/X11/rofi/pass.get @@ -28,14 +28,15 @@ if [ $# -eq 0 ]; then # Specify rofi prompt as 'Get' echo -e "\0prompt\x1fGet" - find ~/.password-store -name '*gpg' -printf %P\\n | \ - sed 's/.gpg$//' + find $HOME/.password-store -name '*gpg' -printf %P\\n | \ + sed 's/.gpg$//' exit 0 fi # Test password exists or not RESULT="$(pass $1)" +set -x if [ -n "$RESULT" ]; then # Copy the given password into PRIMARY selection and kill it in 30s echo "$RESULT" | sed -n 1p | tr -d '\n' | xsel -i -t 30000 @@ -46,12 +47,11 @@ if [ -n "$RESULT" ]; then EXTRA="$(echo; echo; echo "$RESULT" | sed '1d' | sed '1{/^$/d}')" coproc ( rofi -e "Copied: $1$EXTRA" ) -# Password doesn't exist yet -# Go to next rofi execution -elif pass find $1 &>/dev/null; then - echo -e "\0prompt\x1fGPG Issue" - echo Passphase is not chached +elif [ -f "$HOME/.password-store/$1.gpg" ]; then + coproc ( rofi -e "GPG passphase is not chached" ) else + # Password doesn't exist yet + # Go to next rofi execution echo -e "\0prompt\x1f$1" echo -e "\0message\x1fThis password doesn't exist, generate with custom arguments?" echo -e "\0data\x1f$1" -- cgit v1.2.3-70-g09d2