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.
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