From 5ed30a7796e11069b9e6318112acefb85400f90e Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Mon, 16 Jan 2023 12:30:45 +0530 Subject: [PATCH] fish: functions/dotg: Sort the results on basis of time Idea adapted from https://stackoverflow.com/questions/45500978/vim-fzf-sort-initial-results-on-file-date --- fish/.config/fish/functions/dotg.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish/.config/fish/functions/dotg.fish b/fish/.config/fish/functions/dotg.fish index 03e6526..146456d 100644 --- a/fish/.config/fish/functions/dotg.fish +++ b/fish/.config/fish/functions/dotg.fish @@ -5,7 +5,7 @@ function dotg --description 'Generate gstreamer dot graph for selected file' set dotpath "$GST_DEBUG_DUMP_DOT_DIR" end - find $dotpath -maxdepth 1 -regextype posix-extended -regex ".*\.(dot)" | fzf | read -l result + find /tmp/gst-dot -maxdepth 1 -regextype posix-extended -regex ".*\.(dot)" -printf '%T@ %p\n' | sort -k 1 -n -r | fzf | awk -F' ' '{print $2}' | read -l result if test -n "$result" dot -Tsvg "$result" -O