diff --git a/shell/traverse_pdf.sh b/shell/traverse_pdf.sh new file mode 100755 index 0000000..e46dbfe --- /dev/null +++ b/shell/traverse_pdf.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Directory to search (default: current directory or given argument) +SEARCH_DIR="${1:-.}" + +# Your preferred PDF viewer (adjust as needed) +PDF_VIEWER="zathura" + +# Ensure fzf and the viewer exist +command -v fzf >/dev/null 2>&1 || { echo "fzf not found"; exit 1; } +command -v "$PDF_VIEWER" >/dev/null 2>&1 || { echo "$PDF_VIEWER not found"; exit 1; } + +# Find all PDFs recursively and feed them to fzf in a loop +find "$SEARCH_DIR" -type f -iname '*.pdf' | sort | fzf --multi --bind "enter:execute-silent($PDF_VIEWER {} &)" --preview "pdftotext {} - | head -n 20" --preview-window=down:wrap diff --git a/shell/traverse_rnote.sh b/shell/traverse_rnote.sh new file mode 100755 index 0000000..f381c6b --- /dev/null +++ b/shell/traverse_rnote.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Directory to search (default: current directory or given argument) +SEARCH_DIR="${1:-.}" + +# Your Rnote file viewer (default command to open .rnote files) +RNOTE_VIEWER="rnote" + +# Ensure fzf and the viewer exist +command -v fzf >/dev/null 2>&1 || { echo "fzf not found"; exit 1; } +command -v "$RNOTE_VIEWER" >/dev/null 2>&1 || { echo "$RNOTE_VIEWER not found"; exit 1; } + +# Find all .rnote files recursively and open them interactively with fzf +find "$SEARCH_DIR" -type f -iname '*.rnote' | sort | \ +fzf --multi \ + --bind "enter:execute-silent($RNOTE_VIEWER {} &)" \ diff --git a/shell/traverse_typst.sh b/shell/traverse_typst.sh new file mode 100755 index 0000000..b12b3e5 --- /dev/null +++ b/shell/traverse_typst.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# Directory to search (default: current directory or given argument) +SEARCH_DIR="${1:-.}" + +# Your Typst viewer or editor — adjust as needed +TYPST_VIEWER="alacritty -e nvim " # or "typst preview", "helix", "nvim", etc. + +# Ensure required commands exist +command -v fzf >/dev/null 2>&1 || { echo "fzf not found"; exit 1; } + +# Find all .typ files recursively and open them interactively with fzf +find "$SEARCH_DIR" -type f -iname '*.typ' | sort | \ +fzf --multi \ + --bind "enter:execute-silent($TYPST_VIEWER {} &)"