dev: automated commit - 2025-11-10 11:45:17

This commit is contained in:
Mariano Z. 2025-11-10 11:45:17 -03:00
parent 572e1e1ced
commit 2b8553adcc

View file

@ -13,7 +13,7 @@ DEV_DIR=""
for arg in "$@"; do for arg in "$@"; do
case "$arg" in case "$arg" in
--help|-h) --help | -h)
cat <<EOF cat <<EOF
Usage: $0 [DEV_DIR] [OPTIONS] Usage: $0 [DEV_DIR] [OPTIONS]
@ -58,10 +58,10 @@ find_git_repos() {
fi fi
if command -v fd >/dev/null 2>&1; then if command -v fd >/dev/null 2>&1; then
fd -H -t d "^\.git$" "$DEV_DIR" -d 3 -0 | xargs -0 -n1 dirname | sort -u > "$CACHE_FILE" fd -H -t d "^\.git$" "$DEV_DIR" -d 3 -0 | xargs -0 -n1 dirname | sort -u >"$CACHE_FILE"
else else
find "$DEV_DIR" -maxdepth 3 -type d -name ".git" -print0 | \ find "$DEV_DIR" -maxdepth 3 -type d -name ".git" -print0 |
xargs -0 -n1 dirname | sort -u > "$CACHE_FILE" xargs -0 -n1 dirname | sort -u >"$CACHE_FILE"
fi fi
cat "$CACHE_FILE" cat "$CACHE_FILE"
} }
@ -77,9 +77,9 @@ update_mru() {
local temp_file local temp_file
temp_file=$(mktemp) temp_file=$(mktemp)
echo "$selected" > "$temp_file" echo "$selected" >"$temp_file"
[ -f "$MRU_FILE" ] && grep -vFx "$selected" "$MRU_FILE" >> "$temp_file" || true [ -f "$MRU_FILE" ] && grep -vFx "$selected" "$MRU_FILE" >>"$temp_file" || true
head -n "$MRU_SIZE" "$temp_file" > "$MRU_FILE" head -n "$MRU_SIZE" "$temp_file" >"$MRU_FILE"
rm -f "$temp_file" rm -f "$temp_file"
} }
@ -96,8 +96,8 @@ sort_by_mru() {
echo "$mru_list" | sed 's/^/⭐ /' echo "$mru_list" | sed 's/^/⭐ /'
# Output non-MRU items using comm (fast set difference) # Output non-MRU items using comm (fast set difference)
echo "$all_repos" | sort > "$temp_file.all" echo "$all_repos" | sort >"$temp_file.all"
echo "$mru_list" | sort > "$temp_file.mru" echo "$mru_list" | sort >"$temp_file.mru"
comm -23 "$temp_file.all" "$temp_file.mru" 2>/dev/null || cat "$temp_file.all" comm -23 "$temp_file.all" "$temp_file.mru" 2>/dev/null || cat "$temp_file.all"
rm -f "$temp_file.all" "$temp_file.mru" rm -f "$temp_file.all" "$temp_file.mru"
@ -131,7 +131,7 @@ SELECTED_DISPLAY=$(echo "$SORTED_LIST" | tofi \
--border-width 2 \ --border-width 2 \
--outline-width 0 \ --outline-width 0 \
--font "$(fc-match -f '%{family}' 2>/dev/null || echo 'sans')" \ --font "$(fc-match -f '%{family}' 2>/dev/null || echo 'sans')" \
--font-size 14 \ --font-size 16 \
--background-color '#191724' \ --background-color '#191724' \
--text-color '#e0def4' \ --text-color '#e0def4' \
--selection-color '#31748f' \ --selection-color '#31748f' \