2021-12-10 11:09:44 +01:00
|
|
|
function dotg --description 'Generate gstreamer dot graph for selected file'
|
2022-04-03 05:56:07 +02:00
|
|
|
if count $argv >/dev/null
|
|
|
|
set dotpath "$argv"
|
|
|
|
else
|
|
|
|
set dotpath "$GST_DEBUG_DUMP_DOT_DIR"
|
|
|
|
end
|
|
|
|
|
2023-03-03 06:58:28 +01:00
|
|
|
find $dotpath -maxdepth 1 -regextype posix-extended -regex ".*\.(dot)" -printf '%T@ %p\n' | sort -k 1 -n -r | fzf --bind "ctrl-d:half-page-down,ctrl-u:half-page-up" | awk -F' ' '{print $2}' | read -l result
|
2022-04-03 05:56:07 +02:00
|
|
|
|
|
|
|
if test -n "$result"
|
2023-03-03 06:58:28 +01:00
|
|
|
set filename (echo $result | sed 's/\.[^.]*$//')
|
|
|
|
dot -Tsvg "$result" -o "$filename".svg
|
|
|
|
mv "$filename".svg ~/Pictures/gstreamer
|
2022-04-03 05:56:07 +02:00
|
|
|
end
|
2021-12-10 11:09:44 +01:00
|
|
|
end
|