From 8757b2e1a4eca3a33b6ea64ae6f13594823beca6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 8 May 2026 15:41:15 +0200 Subject: [PATCH] Don't look in hidden directories --- bin/omarchy-menu-file | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/omarchy-menu-file b/bin/omarchy-menu-file index 37048e9e..986a7dd8 100755 --- a/bin/omarchy-menu-file +++ b/bin/omarchy-menu-file @@ -30,16 +30,19 @@ for path in "${paths[@]}"; do [[ -e $path ]] || { echo "Path not found: $path" >&2; exit 1; } done -find_args=("${paths[@]}" -type f "(") +find_args=("${paths[@]}" "(" -type d -name ".*" ! -name "." -prune ")" -o -type f "(") +first_format=true for format in "${formats[@]}"; do - if (( ${#find_args[@]} > ${#paths[@]} + 3 )); then + if [[ $first_format == "true" ]]; then + first_format=false + else find_args+=(-o) fi format="${format#.}" find_args+=(-iname "*.$format") done -find_args+=(")") +find_args+=(")" -printf '%T@\t%p\n') -find "${find_args[@]}" -printf '%T@\t%p\n' 2>/dev/null | sort -rn | cut -f2- | +find "${find_args[@]}" 2>/dev/null | sort -rn | cut -f2- | omarchy-launch-walker --dmenu --width 800 --minheight 1 --maxheight 500 -p "$label…" "$@" 2>/dev/null