auto up 23:56:08 up 5:18, 2 users, load average: 0.48, 0.84, 1.05

This commit is contained in:
2025-11-05 23:56:09 +01:00
parent 926210ffc0
commit 8f3a3236de
2 changed files with 20 additions and 7 deletions

View File

@@ -1,16 +1,17 @@
#!/usr/bin/env bash
# Directory to search (default: current directory or given argument)
SEARCH_DIR="${1:-.}"
# Directories to search (default: current directory if none provided)
SEARCH_DIRS=("${@:-.}")
# Your Rnote file viewer (default command to open .rnote files)
# Your Rnote file viewer
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 {} &)" \
# Find all .rnote files recursively, sorted by modification time (newest first)
find "${SEARCH_DIRS[@]}" -type f -iname '*.rnote' -printf '%T@ %p\n' | \
sort -nr | cut -d' ' -f2- | \
fzf --multi \
--bind "enter:execute-silent($RNOTE_VIEWER {} &)"