improvement: styles in theme file, and new exports

This commit is contained in:
2025-06-18 16:35:26 +02:00
parent 3b8c412885
commit a79dfc575e
11 changed files with 119 additions and 52 deletions

View File

@@ -4,6 +4,10 @@
## printf "%s\t%s\t%s\t%s\n" "$i" "$s" "$e" "$description"
##
## @assign startofweek: Date of first day in the week
## @assign style_day: Style for dates
## @assign style_event_delim: Event delimiter
## @assign style_summary: Style for summary lines
## @assign style_time: Style for times
# Functions
@@ -12,7 +16,7 @@
# @input desc: String with a description of the event
# @return: Single-line string
function c(desc) {
return CYAN desc OFF " " RED "/" OFF
return style_summary desc OFF " " style_event_delim
}
# AWK program
@@ -20,19 +24,16 @@ function c(desc) {
BEGIN {
FS = "\t"
OFS = "\t"
GREEN = "\033[1;32m"
RED = "\033[1;31m"
CYAN = "\033[1;36m"
OFF = "\033[m"
}
$2 == "00:00" && $3 == "00:00" { dayline = dayline " " c($4); next }
$2 == "00:00" { dayline = dayline " → " $3 " " c($4); next }
$3 == "00:00" { dayline = dayline " " $2 " → " c($4); next }
NF == 4 { dayline = dayline " " $2 " " $3 " " c($4); next }
$2 == "00:00" { dayline = dayline style_time " → " $3 OFF " " c($4); next }
$3 == "00:00" { dayline = dayline style_time " " $2 " → " OFF c($4); next }
NF == 4 { dayline = dayline style_time " " $2 " " $3 OFF " " c($4); next }
NF == 1 && dayline { print "+", startofweek " +" $1-1 " days", "", dayline }
NF == 1 {
cmd = "date -d '" startofweek " +" $1 " days' +\"%a %e %b %Y\""
cmd | getline dayline
close(cmd)
dayline = GREEN dayline ": " OFF
dayline = style_day dayline ": " OFF
}