Skip to content

Commit f195948

Browse files
committed
Drop support for Day One
1 parent f014676 commit f195948

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

.local/bin/,jrnl

+2-13
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
set -Eeuo pipefail
44

55
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
96
INITIAL_QUERY="${*:-}"
107

118

@@ -26,17 +23,8 @@ export -f reload
2623

2724

2825
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 '![](%s){ width=500px }\n' "${dayone_image}"
37-
3826
printf '\n'
39-
jrnl -on "${1}" --format markdown
27+
jrnl -on "${1}" -n 1 --format markdown
4028
}
4129
export -f prepare
4230

@@ -57,6 +45,7 @@ FZF_DEFAULT_COMMAND="reload $(printf %q "${INITIAL_QUERY}")" \
5745
fzf --ansi \
5846
--bind 'change:reload:sleep 0.1; reload {q}' \
5947
--bind 'enter:execute(show {+1..2} > /dev/tty)' \
48+
--disabled \
6049
--exact \
6150
--multi \
6251
--no-sort \

.local/bin/,jrnl_preview

+1-9
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,11 @@
33
set -Eeuo pipefail
44

55
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-
146
printf "\n$(jrnl -on "${1}" -n 1 --format text)"
157
}
168

179
for date in "$@"
18-
do
10+
do
1911
show "${date}" | \
2012
bat \
2113
--highlight-line 2 \

0 commit comments

Comments
 (0)