From 2ee7f97cc4ae24fdfb0db01c97b461de1e756e2f Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 15 Mar 2022 13:16:02 -0400 Subject: fzf improvements --- hledger-fadd | 7 ++++++- sys | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hledger-fadd b/hledger-fadd index 3e9b9be..b4b7034 100755 --- a/hledger-fadd +++ b/hledger-fadd @@ -13,7 +13,12 @@ function fz { fi } -date=$(for n in $(seq 0 14); do date -d"$n days ago" "+%Y/%m/%d (%a)"; done | fz | awk '{ print $1 }') +date=$(for n in $(seq 0 14); do date -d"$n days ago" "+%Y/%m/%d (%a)"; done \ + | fzf --height 50% --reverse --delimiter '/' \ + --preview="gcal -H yes %{1}{2}{3}" \ + --preview-window 'noborder,top,8' \ + --header-first --header "Today is $(date '+%Y/%m/%d (%a)')" +) echo "date: $date" payee=$(hledger payees | fz --prompt="payee: ") diff --git a/sys b/sys index 3ca7ba5..64706a9 100755 --- a/sys +++ b/sys @@ -1,12 +1,12 @@ #!/usr/bin/env bash systemctl "$@" list-unit-files \ - | tail -n +2 \ | head -n -2 \ - | cut -d' ' -f1 \ | fzf \ - --preview="systemctl $@ status {}" \ + --layout=reverse \ + --preview="systemctl $@ status {1}" \ --preview-window "bottom,follow" \ --header-first \ + --header-lines 1 \ --header="alt-1: status, alt-2: logs" \ - --bind "alt-1:change-preview:systemctl $@ status {}" \ - --bind "alt-2:change-preview:journalctl $@ -fu {}" + --bind "alt-1:change-preview:systemctl $@ status {1}" \ + --bind "alt-2:change-preview:journalctl $@ -fu {1}" -- cgit v1.2.3