aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2023-03-04 17:03:35 +0800
committerHsieh Chin Fan <pham@topo.tw>2023-03-04 17:03:35 +0800
commit0eb25c4e6ad27333d5adf0307c3c775101905061 (patch)
tree93fb764fb4ae62c4158dde53c5821f1a3ed441f9
parentf1b0d6dda0621d049a573479013f33cb762d3f13 (diff)
parent4150a1aec6869abd6e86eee6bb080b42acc9cdfe (diff)
Merge remote-tracking branch 'origin/dev' into dev
-rwxr-xr-xX11/rofi/pass.get14
-rw-r--r--alias2
-rwxr-xr-xbin/wiki/diary4
3 files changed, 10 insertions, 10 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
28 # Specify rofi prompt as 'Get' 28 # Specify rofi prompt as 'Get'
29 echo -e "\0prompt\x1fGet" 29 echo -e "\0prompt\x1fGet"
30 30
31 find ~/.password-store -name '*gpg' -printf %P\\n | \ 31 find $HOME/.password-store -name '*gpg' -printf %P\\n | \
32 sed 's/.gpg$//' 32 sed 's/.gpg$//'
33 33
34 exit 0 34 exit 0
35fi 35fi
36 36
37# Test password exists or not 37# Test password exists or not
38RESULT="$(pass $1)" 38RESULT="$(pass $1)"
39set -x
39if [ -n "$RESULT" ]; then 40if [ -n "$RESULT" ]; then
40 # Copy the given password into PRIMARY selection and kill it in 30s 41 # Copy the given password into PRIMARY selection and kill it in 30s
41 echo "$RESULT" | sed -n 1p | tr -d '\n' | xsel -i -t 30000 42 echo "$RESULT" | sed -n 1p | tr -d '\n' | xsel -i -t 30000
@@ -46,12 +47,11 @@ if [ -n "$RESULT" ]; then
46 EXTRA="$(echo; echo; echo "$RESULT" | sed '1d' | sed '1{/^$/d}')" 47 EXTRA="$(echo; echo; echo "$RESULT" | sed '1d' | sed '1{/^$/d}')"
47 coproc ( rofi -e "Copied: $1$EXTRA" ) 48 coproc ( rofi -e "Copied: $1$EXTRA" )
48 49
49# Password doesn't exist yet 50elif [ -f "$HOME/.password-store/$1.gpg" ]; then
50# Go to next rofi execution 51 coproc ( rofi -e "GPG passphase is not chached" )
51elif pass find $1 &>/dev/null; then
52 echo -e "\0prompt\x1fGPG Issue"
53 echo Passphase is not chached
54else 52else
53 # Password doesn't exist yet
54 # Go to next rofi execution
55 echo -e "\0prompt\x1f$1" 55 echo -e "\0prompt\x1f$1"
56 echo -e "\0message\x1fThis password doesn't exist, generate with custom arguments?" 56 echo -e "\0message\x1fThis password doesn't exist, generate with custom arguments?"
57 echo -e "\0data\x1f$1" 57 echo -e "\0data\x1f$1"
diff --git a/alias b/alias
index 2102a59..e91eec0 100644
--- a/alias
+++ b/alias
@@ -296,7 +296,7 @@ alias b='bean'
296alias cdl='cd ~/log' 296alias cdl='cd ~/log'
297alias chw='tig -C ~/log' 297alias chw='tig -C ~/log'
298ww() { entry="${1:-guideline}"; vim -c Goyo ~/log/${entry%%.md}.md; } 298ww() { entry="${1:-guideline}"; vim -c Goyo ~/log/${entry%%.md}.md; }
299wg() { grep -r "$@" --color --exclude-dir={logseq,.git} ~/log; } 299wg() { grep -r "$@" --color --exclude-dir={logseq,.git,.obsidian} ~/log; }
300wi() { cat ~/log/${1%%.md}.md; } 300wi() { cat ~/log/${1%%.md}.md; }
301alias dia='diary' 301alias dia='diary'
302alias dias='diary specify' 302alias 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 @@
3today=~/log/`date +%y.w%W.md` 3today=~/log/`date +%y.w%W.md`
4 4
5specify_date() { 5specify_date() {
6 YEAR=${YEAR:-22} 6 YEAR=${YEAR:-23}
7 7
8 while read -e -p 'Month? ' -r MONTH </dev/tty; do 8 while read -e -p 'Month? ' -r MONTH </dev/tty; do
9 [ -z $MONTH ] && MONTH=$(date +%m) 9 [ -z $MONTH ] && MONTH=$(date +%m)
@@ -17,7 +17,7 @@ specify_date() {
17 date -d $YEAR-$MONTH-$DAY &>/dev/null && break 17 date -d $YEAR-$MONTH-$DAY &>/dev/null && break
18 done 18 done
19 19
20 FILE=~/log/diary/20$YEAR-$MONTH-$DAY.md 20 FILE=~/log/diary/`date -d $YEAR-$MONTH-$DAY +%y.w%W.md`
21 vim -c 'Goyo' $FILE 21 vim -c 'Goyo' $FILE
22} 22}
23 23