Is there a way to list recent files in Places?

I tried with ^pipe(jgbrowser recent:///) , but doesn’t work.
The AI provided me a script with fzf, python and terminal to process the recently-used.xbel file. It works, but I don’t like it very much.
If anyone knows how to do it, I would appreciate the information.

:people_hugging: :argentina:

Just talked with gpt4all…

sudo find ~/ | grep recently-used

:wink:

[sudo] contraseña para dhbmb:

/home/dhbmb/.local/share/recently-used.xbel …

That is the response, I know I have that file. I need the list of recents files. I wish in Places, but I don’t know how put it there.

1 Like

This is the script provided by AI (Anthropic Claude), with options to edit or something else (as I asked).
(In spanish, don’t ask me to translate…)

#!/bin/bash

# Configurar la localización para manejar caracteres especiales
export LC_ALL=es_ES.UTF-8
export LANG=es_ES.UTF-8

# Seleccionar archivo de los recientes y decodificar la URL
ARCHIVO_URL=$(grep -oP '(?<=href="file://)[^"]+' ~/.local/share/recently-used.xbel | tail -n 20 | fzf --prompt "Archivos recientes: ")

# Si no se seleccionó ningún archivo, salir inmediatamente
if [ -z "$ARCHIVO_URL" ]; then
    exit 0
fi

# Decodificar la URL para manejar tildes y otros caracteres especiales
ARCHIVO=$(python3 -c "import sys, urllib.parse; print(urllib.parse.unquote('$ARCHIVO_URL'))")

# Mostrar el archivo seleccionado
echo "Archivo seleccionado: $ARCHIVO"
echo

# Preguntar si quiere abrir el archivo
read -p "¿Deseas abrir este archivo? (s/n): " RESPUESTA
if [[ $RESPUESTA != "s" && $RESPUESTA != "S" ]]; then
    echo "Operación cancelada."
    exit 0
fi

# Preguntar con qué programa quiere abrirlo
echo
echo "¿Con qué programa deseas abrirlo?"
echo "1) Programa predeterminado"
echo "2) Especificar programa"
read -p "Elige una opción (1/2): " OPCION

case $OPCION in
    1)
        xdg-open "$ARCHIVO"
        ;;
    2)
        read -p "Ingresa el nombre del programa: " PROGRAMA
        "$PROGRAMA" "$ARCHIVO" &
        ;;
    *)
        echo "Opción no válida. Usando programa predeterminado."
        xdg-open "$ARCHIVO"
        ;;
esac

It works fine, but is not that I want

1 Like

See…

3 Likes

:+1:t4: :clap:t4: :flexed_biceps:t4:

2 Likes