This commit is contained in:
Ämin Baumeler 2025-06-06 10:54:38 +02:00
parent 1fd35de475
commit b5682bf435
2 changed files with 21 additions and 13 deletions

View File

@ -1,12 +1,12 @@
# print content of field `field`
BEGIN { FS = ":"; regex = "^" field; }
/^BEGIN:VEVENT$/ { inside = 1 }
/^END:VEVENT/ && inside { exit }
$0 ~ field { content = $0; next; }
/^END:VEVENT$/ { exit }
$0 ~ regex { content = $0; next; }
/^ / && content { content = content substr($0, 2); next; }
/^[^ ]/ && content { exit }
END {
if (!type) { exit }
if (!inside) { exit }
# Process content line
content = substr(content, index(content, ":") + 1);
gsub("\\\\n", "\n", content);

View File

@ -87,15 +87,24 @@ EOF
)
export AWK_DAYVIEW
AWK_PREVIEW=$(
AWK_GET=$(
cat <<'EOF'
@@include src/awk/preview.awk
@@include src/awk/get.awk
EOF
)
export AWK_DAYVIEW
export AWK_GET
### END OF AWK SCRIPTS
FZF_VJOUR_USE_EXPORTED="yes"
export FZF_VJOUR_USE_EXPORTED
## Colors
export GREEN="\033[1;32m"
export RED="\033[1;31m"
export WHITE="\033[1;97m"
export CYAN="\033[1;36m"
export ITALIC="\033[3m"
export FAINT="\033[2m"
export OFF="\033[m"
export FZF_VJOUR_USE_EXPORTED="yes"
fi
__load_approx_data() {
@ -160,8 +169,6 @@ __show_day() {
echo "$s|$e|$starttime|$endtime|$fpath|$description"
done)
fi
GREEN="\033[1;32m"
OFF="\033[m"
echo "||||🗓️ $GREEN $(date -d "$DISPLAY_DATE" +"%a %e %b %Y")$OFF"
echo ""
(
@ -259,10 +266,11 @@ if [ "${1:-}" = "--preview" ]; then
dfmt="$dfmt %Y %R %Z"
fi
end=$(date -d "@$end" +"$dfmt")
echo "START @ $start, END @ $end"
echo "${GREEN}From: ${OFF}${CYAN}$start${OFF}"
echo "${GREEN}To: ${OFF}${CYAN}$end${OFF}"
echo ""
awk -v field="DESCRIPTION" "$AWK_GET" "$fpath" | $CAT
fi
#awk -v field="DESCRIPTION" "$AWK_PREVIEW" "$fpath" |
# $CAT
exit
fi