dotfiles/.local/bin/fuz

52 lines
1.9 KiB
Plaintext
Raw Normal View History

2024-05-17 12:38:17 +02:00
#!/usr/bin/env bash
2024-05-30 09:32:00 +02:00
# Populated by fuz-cache script through xprofile at startup
CACHE_DIR="/tmp/fuz_cache"
2024-06-25 13:52:46 +02:00
h_padding=$(printf '%*s' 14 ' ')
h_gap=$(printf '%*s' 4 ' ')
2024-05-17 12:38:17 +02:00
2024-05-30 09:32:00 +02:00
# Define the header using the escape sequences
HEADER="${h_padding}\
 Prefix:Alt${h_gap}\
 1:All/Folders/Git${h_gap}\
 2:Documents${h_gap}\
 3:Images${h_gap}\
2024-06-25 13:52:46 +02:00
 4:Videos${h_gap}\
 f:lf"
2024-05-25 17:48:42 +02:00
OPENER="fuz-opener"
PREVIEWER="fuz-preview"
2024-05-30 09:32:00 +02:00
cat $CACHE_DIR/all | fzf --ansi --prompt " All  " \
--bind "alt-1:transform:(
([[ \$FZF_PROMPT =~ All ]] && echo 'change-prompt( Folders  )+reload(cat $CACHE_DIR/folders)') ||
([[ \$FZF_PROMPT =~ Folders ]] && echo 'change-prompt( Git  )+reload(cat $CACHE_DIR/git)') ||
echo 'change-prompt( All  )+reload(cat $CACHE_DIR/all)')" \
--bind "alt-2:change-prompt( Documents  )+reload(cat $CACHE_DIR/documents)" \
--bind "alt-3:change-prompt( Images  )+reload(cat $CACHE_DIR/images)" \
--bind "alt-4:change-prompt( Videos  )+reload(cat $CACHE_DIR/videos)" \
--header "$HEADER" \
2024-07-05 08:58:36 +02:00
--height=100% --pointer=" " --ellipsis= --header-first --scheme=path --algo=v2 \
--preview-window "bottom,60%,border-top" --border=none --margin=5%,10%,5%,10% --info=inline-right \
--preview "$PREVIEWER {}" \
2024-06-25 13:52:46 +02:00
--bind "enter:execute:$OPENER {}" \
2024-07-05 08:58:36 +02:00
--highlight-line \
--color=bg+:#2d3f76 \
--color=bg:#1e2030 \
--color=border:#589ed7 \
--color=fg:#c8d3f5 \
--color=gutter:#1e2030 \
--color=header:#ff966c \
--color=hl+:#65bcff \
--color=hl:#65bcff \
--color=info:#545c7e \
--color=marker:#ff007c \
--color=pointer:#ff007c \
--color=prompt:#65bcff \
--color=query:#c8d3f5:regular \
--color=scrollbar:#589ed7 \
--color=separator:#ff966c \
--color=spinner:#ff007c \
2024-06-25 13:52:46 +02:00
--bind "alt-f:execute:lf {}"