improvement: fzf simplified, added TZ theme in dayview

This commit is contained in:
Ämin Baumeler 2025-06-20 10:16:55 +02:00
parent 9097874854
commit 8a23f451b3
2 changed files with 17 additions and 15 deletions

View File

@ -163,13 +163,13 @@ while true; do
--accept-nth='1,2,3,4,5' \
--preview="$0 --preview-event {}" \
--expect="ctrl-n,ctrl-t,ctrl-g,ctrl-alt-d,esc,backspace,q,alt-v,x,c,a" \
--bind="load:pos(1)+transform(
echo change-border-label:🗓️ \$(date -d {1} +\"%A %e %B %Y\")
--bind='load:pos(1)+transform(
echo change-border-label:🗓️ $(date -d {1} +"%A %e %B %Y")
)+transform(
[ -n \"\${TZ:-}\" ] && echo \"change-list-label:\$WHITE\$ITALIC(\$TZ)\$OFF\"
[ -n "${TZ:-}" ] && echo "change-list-label:$STYLE_DV_TZ($TZ)$OFF"
)+transform(
[ -n {5} ] && echo show-preview
)" \
)' \
--bind="start:hide-preview" \
--bind="j:down" \
--bind="k:up" \
@ -243,7 +243,7 @@ while true; do
--print-query \
--bind="start:hide-input" \
--bind="ctrl-alt-d:show-input+change-query(ctrl-alt-d)+accept" \
--bind="load:transform:[ \"\$FZF_TOTAL_COUNT\" -eq 0 ] && echo 'unbind(enter)+unbind(ctrl-alt-d)'" \
--bind='load:transform:[ "$FZF_TOTAL_COUNT" -eq 0 ] && echo "unbind(enter)+unbind(ctrl-alt-d)"' \
--bind="w:toggle-wrap" \
--bind="j:down" \
--bind="k:up" ||
@ -369,19 +369,19 @@ while true; do
--info-command="printf \"$(date +"%R %Z")\"; [ -n \"\${TZ:-}\" ] && printf \" (\$TZ)\"" \
--preview-window=up,7,border-bottom \
--preview="$0 --preview-week {}" \
--bind="load:pos($DISPLAY_POS)" \
--bind="load:pos($DISPLAY_POS)+unbind(load)" \
--expect="ctrl-n,ctrl-g,ctrl-t" \
--bind="q:abort" \
--bind="j:down" \
--bind="k:up" \
--bind="l:unbind(load)+reload:$0 --reload-week {2} '+1 week'" \
--bind="h:unbind(load)+reload:$0 --reload-week {2} '-1 week'" \
--bind="right:unbind(load)+reload:$0 --reload-week {2} '+1 week'" \
--bind="left:unbind(load)+reload:$0 --reload-week {2} '-1 week'" \
--bind="ctrl-l:unbind(load)+reload:$0 --reload-week {2} '+1 month'" \
--bind="ctrl-h:unbind(load)+reload:$0 --reload-week {2} '-1 month'" \
--bind="alt-l:unbind(load)+reload:$0 --reload-week {2} '+1 year'" \
--bind="alt-h:unbind(load)+reload:$0 --reload-week {2} '-1 year'" \
--bind="l:reload:$0 --reload-week {2} '+1 week'" \
--bind="h:reload:$0 --reload-week {2} '-1 week'" \
--bind="right:reload:$0 --reload-week {2} '+1 week'" \
--bind="left:reload:$0 --reload-week {2} '-1 week'" \
--bind="ctrl-l:reload:$0 --reload-week {2} '+1 month'" \
--bind="ctrl-h:reload:$0 --reload-week {2} '-1 month'" \
--bind="alt-l:reload:$0 --reload-week {2} '+1 year'" \
--bind="alt-h:reload:$0 --reload-week {2} '-1 year'" \
--bind="ctrl-r:rebind(load)+reload($0 --reload-week today)+show-preview" \
--bind="ctrl-s:execute($SYNC_CMD ; printf 'Press <enter> to continue.'; read -r tmp)" \
--bind="/:show-input+unbind(q)+unbind(j)+unbind(k)+unbind(l)+unbind(h)+unbind(ctrl-l)+unbind(ctrl-h)+unbind(alt-l)+unbind(alt-h)+unbind(load)+hide-preview+reload:$0 --reload-all" \

View File

@ -10,7 +10,8 @@ ITALIC="\033[3m"
FAINT="\033[2m"
BOLD="\033[1m"
BG="\033[41m"
OFF="\033[m"
export OFF="\033[m"
# Style
# Calendar
@ -36,6 +37,7 @@ export STYLE_DV_TENTATIVE="${STYLE_DV_TENTATIVE:-$FAINT$CYAN}"
export STYLE_DV_CANCELLED="${STYLE_DV_CANCELLED:-$STRIKE$CYAN}"
export STYLE_DV_HOUR="${STYLE_DV_HOUR:-$FAINT}"
export STYLE_DV_EMPTYHOUR="${STYLE_DV_EMPTYHOUR:-$FAINT----------------------$OFF}"
export STYLE_DV_TZ="$WHITE$ITALIC"
# Event preview
export STYLE_EPV_DATETIME="${STYLE_EPV_DATETIME:-$CYAN}"