File tree 2 files changed +3
-22
lines changed
2 files changed +3
-22
lines changed Original file line number Diff line number Diff line change 3
3
set -Eeuo pipefail
4
4
5
5
SCRIPT_DIR=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd -P)
6
- DAYONE_PATH=" $( jrnl --list | tail --lines=2 | head --lines=1 | cut -f5- -d' ' ) "
7
- readonly DAYONE_PATH=" ${DAYONE_PATH/# \~ / $HOME } "
8
- export DAYONE_PATH
9
6
INITIAL_QUERY=" ${*:- } "
10
7
11
8
@@ -26,17 +23,8 @@ export -f reload
26
23
27
24
28
25
function prepare() {
29
- dayone_id=$( jrnl -on " ${1} " \
30
- --config-override editor " tail --lines=1" \
31
- --edit | \
32
- cut -c " 3-" )
33
-
34
- dayone_image=" ${DAYONE_PATH} /photos/${dayone_id} .jpg"
35
-
36
- [ -f " ${dayone_image} " ] && printf ' { width=500px }\n' " ${dayone_image} "
37
-
38
26
printf ' \n'
39
- jrnl -on " ${1} " --format markdown
27
+ jrnl -on " ${1} " -n 1 - -format markdown
40
28
}
41
29
export -f prepare
42
30
@@ -57,6 +45,7 @@ FZF_DEFAULT_COMMAND="reload $(printf %q "${INITIAL_QUERY}")" \
57
45
fzf --ansi \
58
46
--bind ' change:reload:sleep 0.1; reload {q}' \
59
47
--bind ' enter:execute(show {+1..2} > /dev/tty)' \
48
+ --disabled \
60
49
--exact \
61
50
--multi \
62
51
--no-sort \
Original file line number Diff line number Diff line change 3
3
set -Eeuo pipefail
4
4
5
5
function show() {
6
- tags=$( jrnl -on " ${1} " -n 1 --tags)
7
-
8
- if [[ ${tags:: 1} == " [" ]] ; then
9
- printf " " # [No tags found in journal.]
10
- else
11
- printf " # $( echo " ${tags} " | awk ' { print $1 }' ORS=' ' ) "
12
- fi
13
-
14
6
printf " \n$( jrnl -on " ${1} " -n 1 --format text) "
15
7
}
16
8
17
9
for date in " $@ "
18
- do
10
+ do
19
11
show " ${date} " | \
20
12
bat \
21
13
--highlight-line 2 \
You can’t perform that action at this time.
0 commit comments